File tree Expand file tree Collapse file tree
lib/sagittarius/middleware/good_job Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,32 @@ def cleanup_preserved_jobs(event)
118118 end
119119 end
120120
121+ def enqueue_concurrency_limit_exceeded ( event )
122+ job = event . payload [ :job ]
123+ in_context do
124+ logger . info (
125+ message : 'Aborted enqueue of job because concurrency key has reached enqueue limit' ,
126+ job_class : job . class . name ,
127+ execution_id : job . id ,
128+ concurrency_key : event . payload [ :key ] ,
129+ concurrency_limit : event . payload [ :limit ]
130+ )
131+ end
132+ end
133+
134+ def enqueue_concurrency_throttle_exceeded ( event )
135+ job = event . payload [ :job ]
136+ in_context do
137+ logger . info (
138+ message : 'Aborted enqueue of job because concurrency key has reached throttle limit' ,
139+ job_class : job . class . name ,
140+ execution_id : job . id ,
141+ concurrency_key : event . payload [ :key ] ,
142+ concurrency_limit : event . payload [ :limit ]
143+ )
144+ end
145+ end
146+
121147 def systemd_watchdog_start ( event )
122148 in_context { logger . info ( message : 'Pinging systemd watchdog' , interval_s : event . payload [ :interval ] ) }
123149 end
Original file line number Diff line number Diff line change 2020
2121 describe 'good_job' do
2222 it { expect ( GoodJob . migrated? ) . to be true }
23+
24+ it 'log subscriber overrides all log messages' do
25+ ignored_overrides = %i[ info fatal debug unknown error warn logger ]
26+
27+ GoodJob ::LogSubscriber . instance_methods ( false ) . each do |method |
28+ next if ignored_overrides . include? ( method )
29+
30+ expect ( Sagittarius ::Middleware ::GoodJob ::LogSubscriber . method_defined? ( method , false ) )
31+ . to be ( true ) , "#{ Sagittarius ::Middleware ::GoodJob ::LogSubscriber } should define #{ method } "
32+ end
33+ end
2334 end
2435end
2536# rubocop:enable RSpec/DescribeClass
You can’t perform that action at this time.
0 commit comments