Skip to content

Commit

Permalink
Bump slow queue latency to 20 hours
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonkrs committed Oct 13, 2024
1 parent 5dff484 commit 73adff4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/latency_check_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class LatencyCheckController < ApplicationController

def show
queue = SolidQueue::Queue.find_by_name(params.require(:queue))
response = { queue: queue.name, latency: ActiveSupport::Duration.build(queue.latency.to_i).inspect }

if queue.latency > threshold
response = { queue: queue.name, latency: ActiveSupport::Duration.build(queue.latency.to_i).inspect }
render json: response, status: :service_unavailable
else
head :ok
render json: response, status: :ok
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/jobs/user/periodic_mal_sync_job.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User::PeriodicMALSyncJob < ApplicationJob
queue_as :within_10_hours
queue_as :within_20_hours

uniqueness_control key: -> { _1.id }, expires_in: 48.hours

Expand Down
2 changes: 1 addition & 1 deletion config/queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default: &default
threads: 5
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
polling_interval: 0.5
- queues: [within_10_hours]
- queues: [within_20_hours]
threads: 1
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
polling_interval: 2
Expand Down

0 comments on commit 73adff4

Please sign in to comment.