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 101101 coderay (1.1.3 )
102102 concurrent-ruby (1.3.7 )
103103 connection_pool (3.0.2 )
104- crass (1.0.6 )
104+ crass (1.0.7 )
105105 csv (3.3.5 )
106106 database_cleaner-active_record (2.2.2 )
107107 activerecord (>= 5.a )
@@ -127,12 +127,12 @@ GEM
127127 railties (>= 6.1.0 )
128128 ffi (1.17.1 )
129129 fiber-storage (0.1.2 )
130- fugit (1.12.1 )
130+ fugit (1.12.3 )
131131 et-orbi (~> 1.4 )
132132 raabro (~> 1.4 )
133133 globalid (1.3.0 )
134134 activesupport (>= 6.1 )
135- good_job (4.19.0 )
135+ good_job (4.19.1 )
136136 activejob (>= 6.1.0 )
137137 activerecord (>= 6.1.0 )
138138 concurrent-ruby (>= 1.3.1 )
208208 net-smtp (0.5.1 )
209209 net-protocol
210210 nio4r (2.7.5 )
211- nokogiri (1.19.3 )
211+ nokogiri (1.19.4 )
212212 mini_portile2 (~> 2.8.2 )
213213 racc (~> 1.4 )
214214 open3 (0.2.1 )
217217 ast (~> 2.4.1 )
218218 racc
219219 pg (1.6.3 )
220- pp (0.6.3 )
220+ pp (0.6.4 )
221221 prettyprint
222222 prettyprint (0.2.0 )
223223 prism (1.9.0 )
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