Skip to content
代码片段 群组 项目
未验证 提交 e147fbd4 编辑于 作者: Smriti Garg's avatar Smriti Garg 提交者: GitLab
浏览文件

Merge branch 'eduardosanz/swap-order-parameters' into 'master'

Minor improvements in ExpiringWorker class

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/149593



Merged-by: default avatarSmriti Garg <sgarg@gitlab.com>
Approved-by: default avatarKerri Miller <kerrizor@kerrizor.com>
Approved-by: default avatarSmriti Garg <sgarg@gitlab.com>
Co-authored-by: default avatarEduardo Sanz García <esanz-garcia@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -79,8 +79,8 @@ def process_project_access_tokens
with_context(user: user) do
expiring_user_token = user.personal_access_tokens.first # bot user should not have more than 1 token
execute_web_hooks(expiring_user_token, user)
deliver_bot_notifications(expiring_user_token.name, user)
execute_web_hooks(user, expiring_user_token)
deliver_bot_notifications(user, expiring_user_token.name)
end
end
......@@ -91,13 +91,13 @@ def process_project_access_tokens
# rubocop: enable CodeReuse/ActiveRecord
end
def deliver_bot_notifications(token_name, user)
notification_service.bot_resource_access_token_about_to_expire(user, token_name)
def deliver_bot_notifications(bot_user, token_name)
notification_service.bot_resource_access_token_about_to_expire(bot_user, token_name)
Gitlab::AppLogger.info(
message: "Notifying Bot User resource owners about expiring tokens",
class: self.class,
user_id: user.id
user_id: bot_user.id
)
end
......@@ -111,7 +111,7 @@ def deliver_user_notifications(user, token_names)
)
end
def execute_web_hooks(token, bot_user)
def execute_web_hooks(bot_user, token)
resource = bot_user.resource_bot_resource
return if resource.is_a?(Project) && !resource.has_active_hooks?(:resource_access_token_hooks)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册