FIX: sidekiq 100% CPU usage due to `ice_cube`
This commit is contained in:
parent
888060d5d9
commit
1aee217a61
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue