diff --git a/app/jobs/notify_discord_of_thread_job.rb b/app/jobs/notify_discord_of_thread_job.rb index f1e18058..a3670985 100644 --- a/app/jobs/notify_discord_of_thread_job.rb +++ b/app/jobs/notify_discord_of_thread_job.rb @@ -6,7 +6,7 @@ class NotifyDiscordOfThreadJob < ApplicationJob def perform(*args) thread_id = args.shift thread = Thredded::Topic.find_by(id: thread_id) - return unless thread + raise "No thread found for new ID #{thread.id.inspect}" unless thread webhook_url = ENV.fetch('DISCORD_FORUMS_WEBHOOK', '').freeze diff --git a/lib/extensions/thredded/topic.rb b/lib/extensions/thredded/topic.rb index 9b403625..9fe78820 100644 --- a/lib/extensions/thredded/topic.rb +++ b/lib/extensions/thredded/topic.rb @@ -27,7 +27,7 @@ module Extensions end def notify_discord - NotifyDiscordOfThreadJob.perform_later(self.id) + NotifyDiscordOfThreadJob.set(wait: 1.minute).perform_later(self.id) end def create_content_page_share