mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
e1f293ad66
Removed sidetiq, introduced new scheduler - add basic UI - add schedule discover - add scheduling in initializer
20 lines
360 B
Ruby
20 lines
360 B
Ruby
module Scheduler::Schedule
|
|
def every(duration=nil)
|
|
if duration
|
|
@every = duration
|
|
if manager = Scheduler::Manager.current
|
|
manager.ensure_schedule!(self)
|
|
end
|
|
end
|
|
@every
|
|
end
|
|
|
|
def schedule_info
|
|
manager = Scheduler::Manager.without_runner
|
|
manager.schedule_info self
|
|
end
|
|
|
|
def scheduled?
|
|
!!@every
|
|
end
|
|
end
|