Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d2e7b5d0
Commit
d2e7b5d0
authored
Feb 09, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
e16c0f46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/workers/personal_access_tokens/expiring_worker.rb
app/workers/personal_access_tokens/expiring_worker.rb
+6
-4
No files found.
app/workers/personal_access_tokens/expiring_worker.rb
View file @
d2e7b5d0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment