Server: improve confusing condition in crashDump()

This commit is contained in:
Dylan K. Taylor 2021-12-07 23:08:06 +00:00
parent bf29409a45
commit 45b4fa0e96
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1564,7 +1564,8 @@ class Server{
$stamp = Path::join($this->getDataPath(), "crashdumps", ".last_crash");
$crashInterval = 120; //2 minutes
if(($lastReportTime = @filemtime($stamp)) !== false and !($report = ($lastReportTime + $crashInterval < time()))){
if(($lastReportTime = @filemtime($stamp)) !== false and $lastReportTime + $crashInterval >= time()){
$report = false;
$this->logger->debug("Not sending crashdump due to last crash less than $crashInterval seconds ago");
}
@touch($stamp); //update file timestamp