From 125ad85ad039330d68a6e3a50ac544677f1d7d95 Mon Sep 17 00:00:00 2001 From: Vincent Pochet Date: Tue, 26 Nov 2024 16:49:15 +0100 Subject: [PATCH] Cleanup code --- clock.rb | 1 + config/initializers/sidekiq.rb | 2 ++ config/queue_events.yml | 7 +++++-- config/queue_pdfs.yml | 7 +++++-- config/routes.rb | 2 ++ config/sidekiq.yml | 1 + config/sidekiq_events.yml | 1 + config/sidekiq_pdfs.yml | 1 + scripts/start.clock.dev.sh | 1 + scripts/start.clock.sh | 3 ++- spec/clockwork_spec.rb | 1 + 11 files changed, 22 insertions(+), 5 deletions(-) diff --git a/clock.rb b/clock.rb index 5c21b9a5507..a1dda09e8bd 100644 --- a/clock.rb +++ b/clock.rb @@ -4,6 +4,7 @@ require './config/boot' require './config/environment' +# TODO(solid_queue): Remove file module Clockwork handler do |job, time| puts "Running #{job} at #{time}" diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 975e23f51ba..421bd751ce3 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +# TODO(solid_queue): Remove + require 'socket' LIVENESS_PORT = 8080 diff --git a/config/queue_events.yml b/config/queue_events.yml index 1d25db24396..13acc04fe29 100644 --- a/config/queue_events.yml +++ b/config/queue_events.yml @@ -4,8 +4,8 @@ default: &default batch_size: 500 workers: - queues: "events" - threads: 3 - processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + threads: <%= ENV.fetch("JOB_CONCURRENCY", 10) %> + processes: 1 polling_interval: 0.1 development: @@ -14,5 +14,8 @@ development: test: <<: *default +staging: + <<: *default + production: <<: *default diff --git a/config/queue_pdfs.yml b/config/queue_pdfs.yml index 9a69c3ad6f8..221f2d05442 100644 --- a/config/queue_pdfs.yml +++ b/config/queue_pdfs.yml @@ -4,8 +4,8 @@ default: &default batch_size: 500 workers: - queues: "pdfs" - threads: 3 - processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + threads: <%= ENV.fetch("JOB_CONCURRENCY", 10) %> + processes: 1 polling_interval: 3 development: @@ -14,5 +14,8 @@ development: test: <<: *default +staging: + <<: *default + production: <<: *default diff --git a/config/routes.rb b/config/routes.rb index 9abcf6e6dca..e840018dc50 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,8 @@ if ENV['LAGO_JOB_DASHBOARD'] == 'true' mount MissionControl::Jobs::Engine, at: "/jobs" end + # TODO(solid_queue): Remove + mount Sidekiq::Web, at: '/sidekiq' if defined? Sidekiq::Web mount Karafka::Web::App, at: '/karafka' if ENV['KARAFKA_WEB'] mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql' if Rails.env.development? diff --git a/config/sidekiq.yml b/config/sidekiq.yml index a021fd25183..a51f2221e69 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -1,3 +1,4 @@ +# TODO(solid_queue): Remove concurrency: 10 timeout: 25 retry: 1 diff --git a/config/sidekiq_events.yml b/config/sidekiq_events.yml index d3aad191b9a..f85b28f7252 100644 --- a/config/sidekiq_events.yml +++ b/config/sidekiq_events.yml @@ -1,3 +1,4 @@ +# TODO(solid_queue): Remove concurrency: 10 timeout: 25 retry: 1 diff --git a/config/sidekiq_pdfs.yml b/config/sidekiq_pdfs.yml index cf3fbb9a21b..f8f36f45e69 100644 --- a/config/sidekiq_pdfs.yml +++ b/config/sidekiq_pdfs.yml @@ -1,3 +1,4 @@ +# TODO(solid_queue): Remove concurrency: 10 timeout: 25 retry: 1 diff --git a/scripts/start.clock.dev.sh b/scripts/start.clock.dev.sh index dc08f363fcd..757131ef65a 100755 --- a/scripts/start.clock.dev.sh +++ b/scripts/start.clock.dev.sh @@ -1,4 +1,5 @@ #!/bin/bash +# TODO(solid_queue): Remove bundle install bundle exec clockwork ./clock.rb diff --git a/scripts/start.clock.sh b/scripts/start.clock.sh index d84deb68b54..7efa5d553c9 100755 --- a/scripts/start.clock.sh +++ b/scripts/start.clock.sh @@ -1,3 +1,4 @@ #!/bin/bash -bundle exec clockwork ./clock.rb \ No newline at end of file +# TODO(solid_queue): Remove +bundle exec clockwork ./clock.rb diff --git a/spec/clockwork_spec.rb b/spec/clockwork_spec.rb index f5a3d65f4b0..a5046b06f34 100644 --- a/spec/clockwork_spec.rb +++ b/spec/clockwork_spec.rb @@ -2,6 +2,7 @@ require 'rails_helper' +# TODO(solid_queue): Remove describe Clockwork do after { Clockwork::Test.clear! }