Use a readable timestamp and only check the max execute time if it is not zero.
This commit is contained in:
parent
2ef6c3d29b
commit
582a9dc062
1 changed files with 7 additions and 4 deletions
|
@ -337,7 +337,7 @@ function shutdown() {
|
||||||
unlink($LOCK_FILE);
|
unlink($LOCK_FILE);
|
||||||
} else {
|
} else {
|
||||||
$errorTime = time();
|
$errorTime = time();
|
||||||
$query = "INSERT INTO wia_log (time,type,description) VALUES($errorTime,
|
$query = "INSERT INTO wia_log (time,type,description) VALUES(NOW(),
|
||||||
'warning',
|
'warning',
|
||||||
'The script attempted to run while another copy was already processing')";
|
'The script attempted to run while another copy was already processing')";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
|
@ -345,10 +345,13 @@ function shutdown() {
|
||||||
|
|
||||||
$completionTime = time() - $startTime;
|
$completionTime = time() - $startTime;
|
||||||
|
|
||||||
if($completionTime >= ini_get('max_execution_time')) {
|
if($completionTime >= ini_get('max_execution_time') &&
|
||||||
|
ini_get('max_execution_time') != 0) {
|
||||||
$errorTime = time();
|
$errorTime = time();
|
||||||
$query = "INSERT INTO wia_log (time,type,description) VALUES($errorTime,
|
$message = 'The script reached the maximum execution time: ' .
|
||||||
'warning','The script reached the maximum execution time.')";
|
$completionTime;
|
||||||
|
$query = "INSERT INTO wia_log (time,type,description) VALUES(NOW(),
|
||||||
|
'warning','$message')";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue