summaryrefslogtreecommitdiff
path: root/lib/tasks/gitlab/exclusive_lease.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/gitlab/exclusive_lease.rake')
-rw-r--r--lib/tasks/gitlab/exclusive_lease.rake9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/exclusive_lease.rake b/lib/tasks/gitlab/exclusive_lease.rake
new file mode 100644
index 00000000000..83722bf6d94
--- /dev/null
+++ b/lib/tasks/gitlab/exclusive_lease.rake
@@ -0,0 +1,9 @@
+namespace :gitlab do
+ namespace :exclusive_lease do
+ desc 'GitLab | Clear existing exclusive leases for specified scope (default: *)'
+ task :clear, [:scope] => [:environment] do |_, args|
+ args[:scope].nil? ? Gitlab::ExclusiveLease.reset_all! : Gitlab::ExclusiveLease.reset_all!(args[:scope])
+ puts 'All exclusive lease entries were removed.'
+ end
+ end
+end