File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ class SolidQueue::ScheduledExecution < SolidQueue::Execution
8
8
class << self
9
9
def prepare_next_batch ( batch_size )
10
10
transaction do
11
- prepared_job_ids = prepare_batch next_batch ( batch_size ) . lock ( "FOR UPDATE SKIP LOCKED" ) . tap ( &:load )
12
- prepared_job_ids . present?
11
+ batch = next_batch ( batch_size ) . lock ( "FOR UPDATE SKIP LOCKED" ) . tap ( &:load )
12
+ prepare_batch batch
13
13
end
14
14
end
15
15
Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ def initialize(**options)
19
19
20
20
private
21
21
def run
22
- with_polling_volume do
23
- unless select_and_prepare_next_batch
24
- procline "waiting"
25
- interruptible_sleep ( polling_interval )
26
- end
22
+ batch = prepare_next_batch
23
+
24
+ unless batch . size > 0
25
+ procline "waiting"
26
+ interruptible_sleep ( polling_interval )
27
27
end
28
28
end
29
29
30
- def select_and_prepare_next_batch
30
+ def prepare_next_batch
31
31
with_polling_volume do
32
32
SolidQueue ::ScheduledExecution . prepare_next_batch ( batch_size )
33
33
end
You can’t perform that action at this time.
0 commit comments