-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidekiq to solid queue migration #1871
Changes from all commits
b072ac7
0bddd04
9c7b526
42957a9
959dcfd
6f47514
6a2a4c7
088232b
ffa5c37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,11 +114,9 @@ gem "active_interaction" | |
# For stripe payments | ||
gem "stripe" | ||
|
||
# Background job processing adapter | ||
gem "sidekiq", "~> 7.2" | ||
|
||
# job scheduler extension for Sidekiq | ||
gem "sidekiq-scheduler" | ||
# Background job processing adapter and dashboard | ||
gem "mission_control-jobs" | ||
gem "solid_queue", "~> 0.3" | ||
Comment on lines
+118
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add proper description for these two gems |
||
|
||
# searchkick for elasticsearch | ||
gem "elasticsearch", "< 7.14" # select one | ||
|
@@ -209,7 +207,6 @@ group :test, :ci do | |
# Strategies for cleaning databases in Ruby. | ||
gem "database_cleaner", "~> 2.0" | ||
gem "hash_dot" | ||
gem "rspec-sidekiq", git: "https://github.com/wspurgin/rspec-sidekiq", branch: "main" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you noticed any issue on running the jobs on test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 tests were failing after removing this gem because they were using the matchers from this gem. Now I am using matcher from |
||
|
||
gem "rspec-buildkite" | ||
gem "rspec-retry" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-production} | ||
worker: bundle exec sidekiq -e production -C config/sidekiq.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we wanna run the solidqueue worker on production? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added it in fly.production.toml . Do we still need to add it here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make it consistent |
||
worker: bundle exec rake solid_queue:start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
web: bin/rails s -b 0.0.0.0 -p 3000 | ||
webpacker: bin/webpacker-dev-server | ||
sidekiq: bundle exec sidekiq -e development -C config/sidekiq.yml | ||
solidqueue: bundle exec rake solid_queue:start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class MissionControlController < ApplicationController | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you also add a test for this controller? |
||
before_action :authenticate!, if: :restricted_env? | ||
skip_after_action :verify_authorized | ||
|
||
private | ||
|
||
def authenticate! | ||
authenticate_or_request_with_http_basic do |username, password| | ||
username == ENV.fetch("SOLID_QUEUE_USERNAME") && password == ENV.fetch("SOLID_QUEUE_PASSWORD") | ||
end | ||
end | ||
|
||
def restricted_env? | ||
Rails.env.production? | ||
end | ||
end |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
default: &default | ||
dispatchers: | ||
- polling_interval: 1 | ||
batch_size: 500 | ||
recurring_tasks: | ||
update_invoice_status: | ||
class: UpdateInvoiceStatusToOverdueJob | ||
schedule: '0 0 * * *' # Runs every day at 12AM UTC | ||
weekly_reminder: | ||
class: WeeklyReminderToUserJob | ||
schedule: '0 14 * * 1 Asia/Kolkata' # Runs every Monday at 14:00 | ||
workers: | ||
- queues: "*" | ||
threads: 5 | ||
processes: 1 | ||
polling_interval: 0.1 | ||
|
||
development: | ||
<<: *default | ||
|
||
test: | ||
<<: *default | ||
|
||
production: | ||
<<: *default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this until we are getting rid of
Redis
completely