Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20200930144340_set_job_waiter_ttl.rb')
-rw-r--r--db/post_migrate/20200930144340_set_job_waiter_ttl.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/db/post_migrate/20200930144340_set_job_waiter_ttl.rb b/db/post_migrate/20200930144340_set_job_waiter_ttl.rb
deleted file mode 100644
index 347fa4be5a0..00000000000
--- a/db/post_migrate/20200930144340_set_job_waiter_ttl.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class SetJobWaiterTtl < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- SCRIPT = <<~LUA
- if redis.call("ttl", KEYS[1]) < 0 then
- redis.call("expire", KEYS[1], 21600)
- end
- LUA
-
- def up
- Gitlab::Redis::SharedState.with do |redis|
- cursor_init = '0'
- cursor = cursor_init
-
- loop do
- cursor, keys = redis.scan(cursor, match: 'gitlab:job_waiter:*')
-
- redis.pipelined do |redis|
- keys.each { |k| redis.eval(SCRIPT, keys: [k]) }
- end
-
- break if cursor == cursor_init
- end
- end
- end
-
- def down
- end
-end