mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Topic timer for bumping a topic in the future
This commit is contained in:
@ -42,7 +42,8 @@ class TopicTimer < ActiveRecord::Base
|
||||
open: 2,
|
||||
publish_to_category: 3,
|
||||
delete: 4,
|
||||
reminder: 5
|
||||
reminder: 5,
|
||||
bump: 6
|
||||
)
|
||||
end
|
||||
|
||||
@ -108,6 +109,14 @@ class TopicTimer < ActiveRecord::Base
|
||||
Jobs.cancel_scheduled_job(:topic_reminder, topic_timer_id: id)
|
||||
end
|
||||
|
||||
def cancel_auto_bump_job
|
||||
Jobs.cancel_scheduled_job(:bump_topic, topic_timer_id: id)
|
||||
end
|
||||
|
||||
def schedule_auto_bump_job(time)
|
||||
Jobs.enqueue_at(time, :bump_topic, topic_timer_id: id)
|
||||
end
|
||||
|
||||
def schedule_auto_open_job(time)
|
||||
return unless topic
|
||||
topic.update_status('closed', true, user) if !topic.closed
|
||||
|
Reference in New Issue
Block a user