summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class9
1 files changed, 4 insertions, 5 deletions
diff --git a/it.class b/it.class
index 3e83081..8d47b3d 100644
--- a/it.class
+++ b/it.class
@@ -162,7 +162,7 @@ static function error($p = array())
'omitdebuginfo' => false,
'failcount' => 2,
);
- $p += array('blockmailid' => md5($p['to']));
+ $p += array('blockmailid' => $GLOBALS['ULTRASITE'] . "." . md5($p['to']));
@mkdir("/tmp/alertdata");
@chmod("/tmp/alertdata", 0777);
@@ -199,15 +199,14 @@ static function error($p = array())
if ($sendmail)
{
- $lastsentfn = "/tmp/alertdata/lastsent_" . getmyuid() . "." . urlencode($p['blockmailid']);
- $now = time();
+ $lastsentfn = "/tmp/alertdata/it_error_mailsent_" . urlencode($p['blockmailid']);
clearstatcache();
- $lastsenttime = @filemtime($lastsentfn);
- $sendmail = $now - $lastsenttime > $p['blockmail'];
+ $sendmail = time() - max(@filemtime($lastsentfn), it_cache::get($lastsentfn, ['distributed' => true])) > $p['blockmail'];
if ($sendmail)
{
@unlink($lastsentfn);
@touch($lastsentfn);
+ it_cache::put($lastsentfn, time(), ['distributed' => true, 'ttl' => 7*86400, 'safety' => 0]);
}
}
}