mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
e22f1ae186
3am instead of randomly during the day.
28 lines
462 B
Ruby
28 lines
462 B
Ruby
module Scheduler::Schedule
|
|
|
|
def daily(options=nil)
|
|
if options
|
|
@daily = options
|
|
end
|
|
@daily
|
|
end
|
|
|
|
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 || !!@daily
|
|
end
|
|
end
|