Migrate ActiveJob adapter from delayed_job to Sidekiq
Replaces delayed_job with Sidekiq for background job processing. Sidekiq provides better performance through Redis-backed queuing versus database-backed queuing, and is actively maintained.
Core Changes
-
Dependencies: Replace
delayed_job_active_recordwithsidekiq(~> 7.0) andredis(~> 5.0) -
Configuration: Update ActiveJob adapter to
:sidekiq, create Sidekiq initializer with Redis connection and queue configuration matching previous delayed_job setup (single retry, 24-hour timeout) -
Worker Management: Rewrite
lib/seek/workers.rbto manage Sidekiq processes while preserving existing rake task interface (seek:workers:start/stop/restart/status) -
Admin Controller: Update
clear_failed_jobsto use Sidekiq API (Sidekiq::DeadSet,Sidekiq::RetrySet) instead of ActiveRecord queries
Infrastructure
-
Docker: Add Redis service to all docker-compose configurations with
REDIS_URLenvironment variable -
Migration: Drop unused
delayed_jobstable (irreversible) -
Logging: Switch from delayed_job logs to
log/sidekiq.log
Backward Compatibility
Rake tasks and admin interface unchanged. Added delayed_job_pids alias in Seek::Util to maintain compatibility with existing code that checks worker status.
Migration Path
Requires Redis running (localhost:6379 or REDIS_URL env var). See MIGRATION_NOTES_SIDEKIQ.md for installation steps and troubleshooting.
# Queue configuration preserved
QueueNames::DEFAULT = 'default'.freeze # Previously Delayed::Worker.default_queue_name
QueueNames::MAILERS = 'mailers'.freeze # Unchanged
# Worker management API unchanged
Seek::Workers.start # Now starts Sidekiq instead of delayed_job
Seek::Workers.stop # Graceful shutdown with 10s timeout
Original prompt
Migrate the ActiveJob adapter from
delayed_jobtosidekiq
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.