Correctly report the previous success state

This commit is contained in:
Solene Rapenne 2019-07-09 17:04:17 +02:00
parent 9698c24926
commit fd80ed68f6
1 changed files with 10 additions and 6 deletions

View File

@ -121,11 +121,11 @@
(delete-file filepath))
;; it was a failure and then it's back to normal state
(when triggered-before?
(uiop:run-program (trigger-alert level fonction params t 'success) :output t)
(setf previous-state nil))
;; in any case we return t because it's ok
t)
(if triggered-before?
(progn
(uiop:run-program (trigger-alert level fonction params t 'success) :output t)
(setf previous-state nil))
(setf previous-state t)))
;; FAILURE HANDLING
(let ((trigger-now? (or
@ -152,7 +152,11 @@
level fonction (format nil "~{~A ~}" params)
(if previous-state "SUCCESS" "ERROR")
(if current-state "SUCCESS" "ERROR")
trigger-state (+ 1 tries)))
trigger-state
;; use tries variable only if previous errors
(if previous-state
0
(+ 1 tries))))
current-state))
;; abort when using ctrl+c instead of dropping to debugger