Skip to content

Commit 315b592

Browse files
committed
add to cli config
1 parent 99415f2 commit 315b592

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/resque/scheduler/cli.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ module Scheduler
1616
pidfile: 'PIDFILE',
1717
poll_sleep_amount: 'RESQUE_SCHEDULER_INTERVAL',
1818
verbose: 'VERBOSE',
19-
lock_timeout: 'LOCK_TIMEOUT'
19+
lock_timeout: 'LOCK_TIMEOUT',
20+
delayed_requeue_batch_size: 'DELAYED_REQUEUE_BATCH_SIZE',
21+
disable_delayed_requeue_batches: 'DISABLE_DELAYED_REQUEUE_BATCHES'
2022
}.freeze
2123

2224
class Cli
@@ -74,6 +76,18 @@ class Cli
7476
{
7577
args: ['-v', '--verbose', 'Run with verbose output [VERBOSE]'],
7678
callback: ->(options) { ->(v) { options[:verbose] = v } }
79+
},
80+
{
81+
args: ['--lock-timeout [LOCK_TIMEOUT]', 'Lock timeout'],
82+
callback: ->(options) { ->(t) { options[:lock_timeout] = t } }
83+
},
84+
{
85+
args: ['--delayed-requeue-batch-size [DELAYED_REQUEUE_BATCH_SIZE]', 'Delayed requeue batch size'],
86+
callback: ->(options) { ->(d) { options[:delayed_requeue_batch_size] = d } }
87+
},
88+
{
89+
args: ['--disable-delayed-requeue-batches [DISABLE_DELAYED_REQUEUE_BATCHES]', 'Disable delayed requeue batches'],
90+
callback: ->(options) { ->(d) { options[:disable_delayed_requeue_batches] = d } }
7791
}
7892
].freeze
7993

lib/resque/scheduler/env.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def setup_scheduler_configuration
7474
end
7575

7676
c.verbose = !!options[:verbose] if options.key?(:verbose)
77+
78+
c.delayed_requeue_batch_size = Integer(options[:delayed_requeue_batch_size]) if options.key?(:delayed_requeue_batch_size)
79+
80+
c.disable_delayed_requeue_batches = !!options[:disable_delayed_requeue_batches] if options.key?(:disable_delayed_requeue_batches)
7781
end
7882
end
7983
# rubocop:enable Metrics/AbcSize

0 commit comments

Comments
 (0)