mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
use loose comparison instead of strict comparison (#7064)
Update comparison checks when testing the database status and add a unified log message with a more detailed message from the database when there is a failure Authored-by: Tim Fry <tim@fusionpbx.com>
This commit is contained in:
@@ -263,10 +263,12 @@ if (!class_exists('fax_queue')) {
|
||||
$sql = "delete from v_fax_queue where fax_status = 'sent' and fax_date < NOW() - INTERVAL '$retention_days days'";
|
||||
$sql .= " and domain_uuid = '$domain_uuid'";
|
||||
$database->execute($sql);
|
||||
if (!empty($database->message['code']) && $database->message['code'] == 200) {
|
||||
maintenance_service::log_write(self::class, "removed successfully", $domain_uuid);
|
||||
$code = $database->message['code'] ?? 0;
|
||||
if ($code == 200) {
|
||||
maintenance_service::log_write(self::class, "Successfully removed entries older than $retention_days", $domain_uuid);
|
||||
} else {
|
||||
maintenance_service::log_write(self::class, "Unable to remove database entries", $domain_uuid, maintenance_service::LOG_ERROR);
|
||||
$message = $database->message['message'] ?? "An unknown error has occurred";
|
||||
maintenance_service::log_write(self::class, "Unable to remove old database records. Error message: $message ($code)", $domain_uuid, maintenance_service::LOG_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user