summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2007-02-16 12:50:39 +0000
committerUrban Müller2007-02-16 12:50:39 +0000
commit3dd1e42e08611a8eee7506585cf1946c9469cf9d (patch)
treeb466b8d5c2f77c7a155b118be7d7c44f96401753 /it.class
parentf857093ca98c784c01064f30b5ab08e68d98a868 (diff)
downloaditools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.tar.gz
itools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.tar.bz2
itools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.zip
safer timewindow semantics
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index 2bddcd2..1dad9d7 100644
--- a/it.class
+++ b/it.class
@@ -66,8 +66,8 @@ function timerlog($label = '')
* @param $body (optional) error body, multiline
* @param $to (optional) comma separated recipient list
* @param named parameter id identifier of error. if given, only subsequent errors of same id will trigger message
- * @param named parameter timewindow number of seconds within which the second error must occur
* @param named parameter graceperiod number of seconds within which additional errors are ignored
+ * @param named parameter timewindow number of seconds after graceperiod within which the second error must occur
*/
function error($p = array(), $body = "", $to = "")
{
@@ -93,7 +93,7 @@ function error($p = array(), $body = "", $to = "")
$stampfn = $GLOBALS['ULTRAHOME'] . "/tmp/errstamp_" . urlencode($p['id']);
$stampage = time() - @filemtime($stampfn);
- if ($stampage >= $p['graceperiod'] && $stampage <= $p['timewindow'])
+ if ($stampage >= $p['graceperiod'] && $stampage <= $p['graceperiod'] + $p['timewindow'])
$sendalert = true;
if ($stampage >= $p['graceperiod']) # constantly occurring errors should not suppress mail