Replace Sidekiq with Solid Queue for Active Job#100
Closed
JuanVqz wants to merge 1 commit into
Closed
Conversation
Switch the Active Job adapter from :sidekiq to :solid_queue, removing the Redis dependency in favor of the Postgres-backed Solid Queue (already run in-process via SOLID_QUEUE_IN_PUMA in production). - config/application.rb: queue_adapter -> :solid_queue, add solid_queue connects_to the :queue database (was missing; required for the adapter). - config/recurring.yml: port the 3 cron schedules from sidekiq-scheduler. - config/database.yml: add a queue database for development and test (production already had one). - Remove sidekiq + sidekiq-scheduler gems, config/initializers/sidekiq.rb, config/sidekiq.yml. - Procfile: worker now runs bin/jobs. Jobs are plain ActiveJob with no Sidekiq-specific code, so the swap needs no job changes. Verified locally: jobs enqueue into solid_queue_jobs with no Redis, recurring crons parse, full test suite passes (33 runs, 0 failures).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch Active Job from Sidekiq to Solid Queue, dropping the Redis dependency in favor of the Postgres-backed Solid Queue. Solid Queue already runs in-process in production via
SOLID_QUEUE_IN_PUMA: true, so this makes it the actual adapter instead of running alongside an unused Sidekiq wiring.Why
sidekiq/sidekiq-schedulerandsolid_queue. The Active Job adapter was:sidekiq, yetdeploy.ymldoes not provision Redis (commented out) while it does setSOLID_QUEUE_IN_PUMA: true. This consolidates on one backend.Changes
config/application.rb:queue_adapter->:solid_queue; addconfig.solid_queue.connects_to = { database: { writing: :queue } }(was missing entirely and is required for Solid Queue to use thequeuedatabase).config/recurring.yml: port the three cron schedules (daily puzzle, weekly leaderboard, inventory check) fromsidekiq-scheduler.config/database.yml: add aqueuedatabase for development and test (production already defined one).sidekiq+sidekiq-schedulergems,config/initializers/sidekiq.rb,config/sidekiq.yml.Procfile:workernow runsbin/jobs.Verification (local)
solid_queue_jobswith no Redis running.Pending / for Operations
queuePostgres database (ruby_or_rails_production_queue) and runsdb:prepare.SOLID_QUEUE_IN_PUMA(single-server) or split a dedicated worker as traffic grows (already noted indeploy.yml).REDIS_URLreferences from the deploy environment.Draft until Operations confirms the production database/worker setup.