mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 10:29:35 +08:00
21 lines
404 B
Ruby
21 lines
404 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Jobs
|
||
|
class TopicTimerBase < ::Jobs::Base
|
||
|
def execute(args)
|
||
|
@args = args
|
||
|
|
||
|
topic_timer = TopicTimer.find_by(id: args[:topic_timer_id])
|
||
|
return if !topic_timer&.runnable?
|
||
|
|
||
|
topic = topic_timer.topic
|
||
|
if topic.blank?
|
||
|
topic_timer.destroy!
|
||
|
return
|
||
|
end
|
||
|
|
||
|
execute_timer_action(topic_timer, topic)
|
||
|
end
|
||
|
end
|
||
|
end
|