about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2017-09-14 22:12:43 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-14 15:12:43 +0200
commit1aad015bbbe7957827c2b921a21c53ce11c6ac36 (patch)
treee69ffca7fb8dfd6aa039a7269cd25161c0d9d912 /lib
parent94fba44eecf21f5554fc62112aa4b6daff396ff5 (diff)
Revert unique retry job (#4937)
* Revert "Enable UniqueRetryJobMiddleware even when called from sidekiq worker (#4836)"

This reverts commit 6859d4c0289e767955aac3f345074220fe200604.

* Revert "Do not execute the job with the same arguments as the retry job (#4814)"

This reverts commit be7ffa2d7539d5a1946a3933cb9d242b9fac0ddc.
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/unique_retry_job_middleware.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/mastodon/unique_retry_job_middleware.rb b/lib/mastodon/unique_retry_job_middleware.rb
deleted file mode 100644
index 75da8a0c9..000000000
--- a/lib/mastodon/unique_retry_job_middleware.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class Mastodon::UniqueRetryJobMiddleware
-  def call(_worker_class, item, _queue, _redis_pool)
-    return if item['unique_retry'] && retried?(item)
-    yield
-  end
-
-  private
-
-  def retried?(item)
-    # Use unique digest key of SidekiqUniqueJobs
-    unique_key = SidekiqUniqueJobs::UNIQUE_DIGEST_KEY
-    unique_digest = item[unique_key]
-    class_name = item['class']
-    retries = Sidekiq::RetrySet.new
-
-    retries.any? { |job| job.item['class'] == class_name && job.item[unique_key] == unique_digest }
-  end
-end