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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -621,10 +621,6 @@ class voipWatch extends voip {
|
||||
$time = time();
|
||||
}
|
||||
|
||||
if ($process_id) {
|
||||
process_clear_log($process_id);
|
||||
}
|
||||
|
||||
} while ($this->keepWatching);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user