about summary refs log tree commit diff
path: root/db/migrate/20200508212852_reset_unique_jobs_locks.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-05-13 23:46:09 +0200
committerGitHub <noreply@github.com>2020-05-13 23:46:09 +0200
commite1d282023432ff4a88cb795f3a9889704314e448 (patch)
tree89f9525142d0bf876a4fb6e0117163c0a76bb78a /db/migrate/20200508212852_reset_unique_jobs_locks.rb
parentc6ff4c634caf718adf7280e04909c091d15add1d (diff)
parentd147dd7588502f22ac825780bb1d6e54eb3613e6 (diff)
Merge pull request #1327 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db/migrate/20200508212852_reset_unique_jobs_locks.rb')
-rw-r--r--db/migrate/20200508212852_reset_unique_jobs_locks.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20200508212852_reset_unique_jobs_locks.rb b/db/migrate/20200508212852_reset_unique_jobs_locks.rb
new file mode 100644
index 000000000..3ffdeb0aa
--- /dev/null
+++ b/db/migrate/20200508212852_reset_unique_jobs_locks.rb
@@ -0,0 +1,12 @@
+class ResetUniqueJobsLocks < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    # We do this to clean up unique job digests that were not properly
+    # disposed of prior to https://github.com/tootsuite/mastodon/pull/13361
+
+    SidekiqUniqueJobs::Digests.delete_by_pattern('*', count: SidekiqUniqueJobs::Digests.count)
+  end
+
+  def down; end
+end