diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-05-23 14:09:45 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-05-24 22:29:59 +0200 |
commit | ff8ecbca17234897b26ea8de5caecaef1667d12d (patch) | |
tree | 8f7966d5cbf2684772dbbf5ec05ccee1f48b76e0 /lib/tasks/tokens.rake | |
parent | 3713a57fe8c40bfccaa668d081caccb92354b1da (diff) | |
download | gitlab-ce-ff8ecbca17234897b26ea8de5caecaef1667d12d.tar.gz |
rake task to reset all rss tokens
Diffstat (limited to 'lib/tasks/tokens.rake')
-rw-r--r-- | lib/tasks/tokens.rake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/tokens.rake b/lib/tasks/tokens.rake index 95735f43802..893c69d6e89 100644 --- a/lib/tasks/tokens.rake +++ b/lib/tasks/tokens.rake @@ -11,6 +11,11 @@ namespace :tokens do reset_all_users_token(:reset_incoming_email_token!) end + desc "Reset all GitLab rss tokens" + task reset_all_rss: :environment do + reset_all_users_token(:reset_rss_token!) + end + def reset_all_users_token(reset_token_method) TmpUser.find_in_batches do |batch| puts "Processing batch starting with user ID: #{batch.first.id}" @@ -35,4 +40,9 @@ class TmpUser < ActiveRecord::Base write_new_token(:incoming_email_token) save!(validate: false) end + + def reset_rss_token! + write_new_token(:rss_token) + save!(validate: false) + end end |