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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 00:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 00:09:08 +0300
commitd2e7b5d069d9419b4cac69243beefa358a04e025 (patch)
treee939fa26b8039b32b599bad22500d94807bbbed7
parente16c0f461fcacffa4e56cf44f9563261d6b5c080 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/workers/personal_access_tokens/expiring_worker.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/workers/personal_access_tokens/expiring_worker.rb b/app/workers/personal_access_tokens/expiring_worker.rb
index b291e9ef279..84f7ce9d5d7 100644
--- a/app/workers/personal_access_tokens/expiring_worker.rb
+++ b/app/workers/personal_access_tokens/expiring_worker.rb
@@ -3,7 +3,7 @@
module PersonalAccessTokens
class ExpiringWorker
include ApplicationWorker
- include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
+ include CronjobQueue
feature_category :authentication_and_authorization
@@ -12,11 +12,13 @@ module PersonalAccessTokens
limit_date = PersonalAccessToken::DAYS_TO_EXPIRE.days.from_now.to_date
User.with_expiring_and_not_notified_personal_access_tokens(limit_date).find_each do |user|
- notification_service.access_token_about_to_expire(user)
+ with_context(user: user) do
+ notification_service.access_token_about_to_expire(user)
- Rails.logger.info "#{self.class}: Notifying User #{user.id} about expiring tokens" # rubocop:disable Gitlab/RailsLogger
+ Rails.logger.info "#{self.class}: Notifying User #{user.id} about expiring tokens" # rubocop:disable Gitlab/RailsLogger
- user.personal_access_tokens.expiring_and_not_notified(limit_date).update_all(expire_notification_delivered: true)
+ user.personal_access_tokens.expiring_and_not_notified(limit_date).update_all(expire_notification_delivered: true)
+ end
end
end
end