Added dbclean
This commit is contained in:
parent
e14a5fbcd7
commit
db72533233
@ -88,3 +88,12 @@ function parse_config_type($type) {
|
||||
}
|
||||
return $r_var;
|
||||
}
|
||||
|
||||
function clean_database() {
|
||||
global $db;
|
||||
|
||||
$oldestrun = time() - (60 * 60 * 24 * get_configvalue('dbclean.expireruns'));
|
||||
|
||||
$stmt = $db->prepare("DELETE FROM runs WHERE timestamp < ?");
|
||||
$stmt->execute(array($oldestrun));
|
||||
}
|
@ -105,6 +105,8 @@ foreach ($results as $result) {
|
||||
$nosave = false;
|
||||
}
|
||||
|
||||
clean_database();
|
||||
|
||||
unlink('/tmp/webcron.lock');
|
||||
|
||||
if(file_exists("cache/reboot.trigger")) {
|
||||
|
Loading…
Reference in New Issue
Block a user