diff options
| -rw-r--r-- | it.class | 9 | 
1 files changed, 4 insertions, 5 deletions
| @@ -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]);  			}  		}  	} |