diff options
author | Urban Müller | 2007-02-16 12:50:39 +0000 |
---|---|---|
committer | Urban Müller | 2007-02-16 12:50:39 +0000 |
commit | 3dd1e42e08611a8eee7506585cf1946c9469cf9d (patch) | |
tree | b466b8d5c2f77c7a155b118be7d7c44f96401753 | |
parent | f857093ca98c784c01064f30b5ab08e68d98a868 (diff) | |
download | itools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.tar.gz itools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.tar.bz2 itools-3dd1e42e08611a8eee7506585cf1946c9469cf9d.zip |
safer timewindow semantics
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |