2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Clear log in a general way using the system sort process as will only run periodically

This commit is contained in:
azammitdcarf
2012-10-04 00:06:30 +00:00
parent 2a394951f6
commit a76c8f604f
3 changed files with 4 additions and 12 deletions

View File

@@ -206,7 +206,7 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
sleep($sleepinterval);
}
process_clear_log($process_id);
process_clear_log();
}
disable_systemsort();

View File

@@ -248,25 +248,21 @@ function process_get_last_data($type = 1)
/**
* Don't let the log get too big for this process
* Don't let the log get too big
*
* @param int $process_id The process id
*
* @author Adam Zammit <adam.zammit@acspri.org.au>
* @since 2012-09-27
*/
function process_clear_log($process_id)
function process_clear_log()
{
global $db;
$sql =
"DELETE FROM process_log WHERE process_id = '$process_id' AND
process_log_id NOT IN (
"DELETE FROM process_log WHERE process_log_id NOT IN (
SELECT process_log_id
FROM (
SELECT process_log_id
FROM process_log
WHERE process_id = '$process_id'
ORDER BY process_log_id DESC
LIMIT " . (PROCESS_LOG_LIMIT * 3) . "
) x

View File

@@ -621,10 +621,6 @@ class voipWatch extends voip {
$time = time();
}
if ($process_id) {
process_clear_log($process_id);
}
} while ($this->keepWatching);
}