mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 10:31:10 +08:00
FIX: Ensure that we cancel any timeout jobs when terminating a track.
This commit is contained in:
@ -163,21 +163,6 @@ module DiscourseNarrativeBot
|
||||
topic_id == @data[:topic_id]
|
||||
end
|
||||
|
||||
def cancel_timeout_job(user)
|
||||
Jobs.cancel_scheduled_job(:narrative_timeout, user_id: user.id, klass: self.class.to_s)
|
||||
end
|
||||
|
||||
def enqueue_timeout_job(user)
|
||||
return if Rails.env.test?
|
||||
|
||||
cancel_timeout_job(user)
|
||||
|
||||
Jobs.enqueue_in(TIMEOUT_DURATION, :narrative_timeout,
|
||||
user_id: user.id,
|
||||
klass: self.class.to_s
|
||||
)
|
||||
end
|
||||
|
||||
def not_implemented
|
||||
raise 'Not implemented.'
|
||||
end
|
||||
|
Reference in New Issue
Block a user