about summary refs log tree commit diff
path: root/app/workers/thread_resolve_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/thread_resolve_worker.rb')
-rw-r--r--app/workers/thread_resolve_worker.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/workers/thread_resolve_worker.rb b/app/workers/thread_resolve_worker.rb
new file mode 100644
index 000000000..84eae73be
--- /dev/null
+++ b/app/workers/thread_resolve_worker.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class ThreadResolveWorker
+  include Sidekiq::Worker
+
+  def perform(child_status_id, parent_url)
+    child_status  = Status.find(child_status_id)
+    parent_status = FetchRemoteStatusService.new.call(parent_url)
+
+    return if parent_status.nil?
+
+    child_status.thread = parent_status
+    child_status.save!
+  end
+end