]> cat aescling's git repositories - mastodon.git/blob - app/workers/thread_resolve_worker.rb
Retry thread resolving (#5599)
[mastodon.git] / app / workers / thread_resolve_worker.rb
1 # frozen_string_literal: true
2
3 class ThreadResolveWorker
4 include Sidekiq::Worker
5
6 sidekiq_options queue: 'pull', retry: 3
7
8 sidekiq_retry_in do |count|
9 15 + 10 * (count**4) + rand(10 * (count**4))
10 end
11
12 def perform(child_status_id, parent_url)
13 child_status = Status.find(child_status_id)
14 parent_status = FetchRemoteStatusService.new.call(parent_url)
15
16 return if parent_status.nil?
17
18 child_status.thread = parent_status
19 child_status.save!
20 end
21 end
This page took 0.072136 seconds and 4 git commands to generate.