Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 631e59e

Browse files
author
Derik Evangelista
committed
v3: ensure that polling interval is an int
[#174144484](https://www.pivotaltracker.com/story/show/174144484)
1 parent 8a0668f commit 631e59e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/jobs/reoccurring_job.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def polling_interval_seconds
3434
end
3535

3636
def polling_interval_seconds=(interval)
37+
interval = interval.to_i if interval.is_a? String
3738
@polling_interval = if interval < default_polling_interval_seconds
3839
default_polling_interval_seconds
3940
elsif interval > 24.hours

spec/unit/jobs/reoccurring_job_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def perform
100100

101101
context 'updates the polling interval if config changes' do
102102
it 'when changed from the job only' do
103-
job = FakeJob.new(retry_after: [20, 30])
103+
job = FakeJob.new(retry_after: ['20', '30'])
104104
TestConfig.config[:broker_client_default_async_poll_interval_seconds] = 10
105105

106106
enqueued_time = Time.now

0 commit comments

Comments
 (0)