Use a readable timestamp and only check the max execute time if it is not zero.

This commit is contained in:
Andrew Tomaka 2011-10-15 08:27:08 -04:00
parent 2ef6c3d29b
commit 582a9dc062

View file

@ -337,7 +337,7 @@ function shutdown() {
unlink($LOCK_FILE);
} else {
$errorTime = time();
$query = "INSERT INTO wia_log (time,type,description) VALUES($errorTime,
$query = "INSERT INTO wia_log (time,type,description) VALUES(NOW(),
'warning',
'The script attempted to run while another copy was already processing')";
$db->query($query);
@ -345,10 +345,13 @@ function shutdown() {
$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();
$query = "INSERT INTO wia_log (time,type,description) VALUES($errorTime,
'warning','The script reached the maximum execution time.')";
$message = 'The script reached the maximum execution time: ' .
$completionTime;
$query = "INSERT INTO wia_log (time,type,description) VALUES(NOW(),
'warning','$message')";
$db->query($query);
}
}