Production was logging failures for the purge_rs_authorization_codes recurring task:
NameError: uninitialized constant SolidQueue::RecurringJob::RsAuthorizationCode
(eval at .../solid_queue-1.1.5/app/jobs/solid_queue/recurring_job.rb:7):1:in `perform'
The task used a command: string, which Solid Queue evals inside its own SolidQueue::RecurringJob. That only resolves the constant if the process executing it has the class loaded, and the task is only ever visible in Mission Control as SolidQueue::RecurringJob rather than under a real job name. The recorded stack trace came from a worker on Rails 8.0.2 / solid_queue 1.1.5 — a stale process from before the Rails 8.1 upgrade picking jobs off the shared queue database.
This moves the cleanup into a normal Active Job, so the scheduler enqueues PurgeRsAuthorizationCodesJob on the default queue. It no longer relies on evaling a string and shows up under its own class name. The query and the hourly schedule are unchanged.
Changes:
app/jobs/purge_rs_authorization_codes_job.rb — new job holding the existing RsAuthorizationCode.where(expires_at: ..1.hour.ago).delete_all query.
config/recurring.yml — task now uses class: PurgeRsAuthorizationCodesJob instead of command:.
spec/jobs/purge_rs_authorization_codes_job_spec.rb — covers deletion beyond the one-hour grace period and retention of recently expired/active codes (2 examples, green).
Note: this change on its own won't stop the production errors while the stale worker/VM that recorded the trace is still running; that process needs to be stopped separately.
Production was logging failures for the `purge_rs_authorization_codes` recurring task:
```
NameError: uninitialized constant SolidQueue::RecurringJob::RsAuthorizationCode
(eval at .../solid_queue-1.1.5/app/jobs/solid_queue/recurring_job.rb:7):1:in `perform'
```
The task used a `command:` string, which Solid Queue `eval`s inside its own `SolidQueue::RecurringJob`. That only resolves the constant if the process executing it has the class loaded, and the task is only ever visible in Mission Control as `SolidQueue::RecurringJob` rather than under a real job name. The recorded stack trace came from a worker on Rails 8.0.2 / solid_queue 1.1.5 — a stale process from before the Rails 8.1 upgrade picking jobs off the shared queue database.
This moves the cleanup into a normal Active Job, so the scheduler enqueues `PurgeRsAuthorizationCodesJob` on the `default` queue. It no longer relies on `eval`ing a string and shows up under its own class name. The query and the hourly schedule are unchanged.
Changes:
- `app/jobs/purge_rs_authorization_codes_job.rb` — new job holding the existing `RsAuthorizationCode.where(expires_at: ..1.hour.ago).delete_all` query.
- `config/recurring.yml` — task now uses `class: PurgeRsAuthorizationCodesJob` instead of `command:`.
- `spec/jobs/purge_rs_authorization_codes_job_spec.rb` — covers deletion beyond the one-hour grace period and retention of recently expired/active codes (2 examples, green).
Note: this change on its own won't stop the production errors while the stale worker/VM that recorded the trace is still running; that process needs to be stopped separately.
The recurring cleanup task used a `command:` string, which Solid Queue evals inside SolidQueue::RecurringJob. It failed in production with `uninitialized constant ...::RsAuthorizationCode` and is only visible in Mission Control as SolidQueue::RecurringJob. Move the cleanup into a regular Active Job class so the task is enqueued as PurgeRsAuthorizationCodesJob on the default queue, appears under its own name, and no longer depends on eval'ing a string.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Production was logging failures for the
purge_rs_authorization_codesrecurring task:The task used a
command:string, which Solid Queueevals inside its ownSolidQueue::RecurringJob. That only resolves the constant if the process executing it has the class loaded, and the task is only ever visible in Mission Control asSolidQueue::RecurringJobrather than under a real job name. The recorded stack trace came from a worker on Rails 8.0.2 / solid_queue 1.1.5 — a stale process from before the Rails 8.1 upgrade picking jobs off the shared queue database.This moves the cleanup into a normal Active Job, so the scheduler enqueues
PurgeRsAuthorizationCodesJobon thedefaultqueue. It no longer relies onevaling a string and shows up under its own class name. The query and the hourly schedule are unchanged.Changes:
app/jobs/purge_rs_authorization_codes_job.rb— new job holding the existingRsAuthorizationCode.where(expires_at: ..1.hour.ago).delete_allquery.config/recurring.yml— task now usesclass: PurgeRsAuthorizationCodesJobinstead ofcommand:.spec/jobs/purge_rs_authorization_codes_job_spec.rb— covers deletion beyond the one-hour grace period and retention of recently expired/active codes (2 examples, green).Note: this change on its own won't stop the production errors while the stale worker/VM that recorded the trace is still running; that process needs to be stopped separately.