Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
glucas
picomon
Commits
fec4da3f
Commit
fec4da3f
authored
Sep 03, 2014
by
Colomban Wendling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix retry count in recovery notifications
parent
9c58d8d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
picomon/checks.py
picomon/checks.py
+2
-2
picomon/mails.py
picomon/mails.py
+1
-1
No files found.
picomon/checks.py
View file @
fec4da3f
...
...
@@ -67,8 +67,8 @@ class Check(object):
self
.
setup
()
if
not
self
.
check
():
logging
.
debug
(
'Fail: '
+
str
(
self
))
self
.
retry_count
=
min
(
self
.
retry_count
+
1
,
self
.
retry
)
if
self
.
retry_count
=
=
self
.
retry
or
immediate
:
self
.
retry_count
+
=
1
if
self
.
retry_count
>
=
self
.
retry
or
immediate
:
if
self
.
ok
:
logging
.
debug
(
'Switched to failure: '
+
str
(
self
))
self
.
failure_date
=
datetime
.
now
()
...
...
picomon/mails.py
View file @
fec4da3f
...
...
@@ -105,7 +105,7 @@ def send_email_for_check(check):
delta
=
datetime
.
now
()
-
check
.
failure_date
# remove microsec
delta
=
delta
-
timedelta
(
microseconds
=
delta
.
microseconds
)
n
=
delta
//
timedelta
(
seconds
=
check
.
error_every
*
config
.
base_tick
)
n
=
check
.
retry_count
+
1
-
check
.
retry
msg_text
+=
(
"recovered after %s (%d %s)."
%
(
delta
,
n
,
"retry"
if
n
==
1
else
"retries"
))
else
:
...
...
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