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
3c256256
Commit
3c256256
authored
Mar 07, 2019
by
rpereira2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move firings.any? into the send_email? function
parent
3a3ce423
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
ee/app/services/projects/prometheus/alerts/notify_service.rb
ee/app/services/projects/prometheus/alerts/notify_service.rb
+4
-3
No files found.
ee/app/services/projects/prometheus/alerts/notify_service.rb
View file @
3c256256
...
...
@@ -8,7 +8,7 @@ module Projects
return
false
unless
valid_version?
return
false
unless
valid_alert_manager_token?
(
token
)
send_alert_email
if
send_email?
&&
firings
.
any?
send_alert_email
if
send_email?
persist_events
(
project
,
params
)
true
...
...
@@ -25,11 +25,12 @@ module Projects
end
def
send_email?
return
true
unless
incident_management_feature_enabled?
return
firings
.
any?
unless
incident_management_feature_enabled?
return
false
unless
has_incident_management_license?
setting
=
project
.
incident_management_setting
||
project
.
build_incident_management_setting
setting
.
send_email
setting
.
send_email
&&
firings
.
any?
end
def
firings
...
...
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