diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb index ca96fd87211..750a7ecfe2b 100644 --- a/app/jobs/scheduled/poll_mailbox.rb +++ b/app/jobs/scheduled/poll_mailbox.rb @@ -6,7 +6,7 @@ require_dependency 'email/receiver' module Jobs class PollMailbox < Jobs::Scheduled - recurrence { minutely(5) } + recurrence { hourly.minute_of_hour(0,5,10,15,20,25,30,35,40,45,50,55) } sidekiq_options retry: false def execute(args) diff --git a/lib/freedom_patches/ice_cube.rb b/lib/freedom_patches/ice_cube.rb new file mode 100644 index 00000000000..3e17477e744 --- /dev/null +++ b/lib/freedom_patches/ice_cube.rb @@ -0,0 +1,16 @@ +module IceCube + class MinutelyRule < ValidatedRule + def initialize(interval = 1, week_start = :sunday) + super + + unless interval == 1 + raise "Due to a gigantic awful bug in ice_cube, don't specify an interval for minutely. Use `hourly.minute_of_hour`" + end + + interval(interval) + schedule_lock(:sec) + reset + end + end +end +