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
31d878a6
Commit
31d878a6
authored
Mar 09, 2021
by
Matija Čupić
Committed by
Rémy Coutable
Mar 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce DB load when resetting CI minute notifications
parent
f0337d33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
changelogs/unreleased/mc-bug-reduce-ci-minute-namespace-notification-db-load.yml
...c-bug-reduce-ci-minute-namespace-notification-db-load.yml
+5
-0
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+5
-0
ee/app/services/ci/minutes/batch_reset_service.rb
ee/app/services/ci/minutes/batch_reset_service.rb
+3
-2
No files found.
changelogs/unreleased/mc-bug-reduce-ci-minute-namespace-notification-db-load.yml
0 → 100644
View file @
31d878a6
---
title
:
Reduce DB load when resetting CI minute notifications.
merge_request
:
55765
author
:
type
:
performance
ee/app/models/ee/namespace.rb
View file @
31d878a6
...
...
@@ -69,6 +69,11 @@ module EE
where
(
"EXISTS (?)"
,
matcher
)
end
scope
:without_last_ci_minutes_notification
,
->
do
where
.
not
(
last_ci_minutes_notification_at:
nil
)
.
or
(
where
.
not
(
last_ci_minutes_usage_notification_level:
nil
))
end
delegate
:shared_runners_seconds
,
:shared_runners_seconds_last_reset
,
to: :namespace_statistics
,
allow_nil:
true
delegate
:additional_purchased_storage_size
,
:additional_purchased_storage_size
=
,
...
...
ee/app/services/ci/minutes/batch_reset_service.rb
View file @
31d878a6
...
...
@@ -111,9 +111,10 @@ module Ci
end
def
reset_ci_minutes_notifications!
(
namespaces
)
namespaces
.
update_all
(
namespaces
.
without_last_ci_minutes_notification
.
update_all
(
last_ci_minutes_notification_at:
nil
,
last_ci_minutes_usage_notification_level:
nil
)
last_ci_minutes_usage_notification_level:
nil
)
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