seek icon indicating copy to clipboard operation
seek copied to clipboard

Migrate ActiveJob adapter from delayed_job to Sidekiq

Open Copilot opened this issue 2 months ago • 1 comments

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_record with sidekiq (~> 7.0) and redis (~> 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.rb to manage Sidekiq processes while preserving existing rake task interface (seek:workers:start/stop/restart/status)
  • Admin Controller: Update clear_failed_jobs to use Sidekiq API (Sidekiq::DeadSet, Sidekiq::RetrySet) instead of ActiveRecord queries

Infrastructure

  • Docker: Add Redis service to all docker-compose configurations with REDIS_URL environment variable
  • Migration: Drop unused delayed_jobs table (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_job to sidekiq


💡 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.

Copilot avatar Dec 05 '25 12:12 Copilot