mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
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)
|
||||
|
16
lib/freedom_patches/ice_cube.rb
Normal file
16
lib/freedom_patches/ice_cube.rb
Normal file
@ -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
Block a user