Commit 9db14549 authored by vogelor's avatar vogelor

Fixed a error in cleaning the remote-actions - Table

parent 45841f08
......@@ -225,9 +225,17 @@ if ($app->dbmaster == $app->db) {
$app->dbmaster->query($sql);
/*
* Delete all remote-actions "done" and older than 7 days
* Delete all remote-actions "done" and older than 7 days
* ATTENTION: We have the same problem as described in cleaning the datalog. We must not
* delete the last entry
*/
$sql = "DELETE FROM sys_remoteaction WHERE tstamp < " . $tstamp . " AND action_status = 'ok'";
$sql = "SELECT max(action_id) FROM sys_remoteaction";
$res = $app->dbmaster->queryOneRecord($sql);
$maxId = $res['max(action_id)'];
$sql = "DELETE FROM sys_remoteaction " .
"WHERE tstamp < " . $tstamp . " " .
" AND action_status = 'ok' " .
" AND action_id <" . intval($maxId);
$app->dbmaster->query($sql);
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment