Merge branch 'feature/disable-dbclean'
This commit is contained in:
commit
b9e8c2f361
@ -37,7 +37,8 @@ CREATE TABLE IF NOT EXISTS `config` (
|
|||||||
|
|
||||||
INSERT INTO `config` (`conf`, `category`, `type`, `label`, `description`, `value`) VALUES
|
INSERT INTO `config` (`conf`, `category`, `type`, `label`, `description`, `value`) VALUES
|
||||||
('dbclean.delay', 'Database Cleanup', 'number(0)', 'Cleanup Delay', 'How many days until the database cleanup is triggered', '7'),
|
('dbclean.delay', 'Database Cleanup', 'number(0)', 'Cleanup Delay', 'How many days until the database cleanup is triggered', '7'),
|
||||||
('dbclean.expireruns', 'Database Cleanup', 'number(0)', 'Retention value', 'How many days does the database keep the runs', '30'),
|
('dbclean.expireruns', 'Database Cleanup', 'number(0)', 'Retention', 'How many days does the database keep the runs', '30'),
|
||||||
|
('dbclean.enabled', 'Database Cleanup', 'text', 'Enabled', 'Database cleanup enabled? (true: yes; false: no)', 'false'),
|
||||||
('dbclean.lastrun', 'Database Cleanup', 'hidden', 'Last run', 'Last run of database cleanup', UNIX_TIMESTAMP()),
|
('dbclean.lastrun', 'Database Cleanup', 'hidden', 'Last run', 'Last run of database cleanup', UNIX_TIMESTAMP()),
|
||||||
('jobs.reboottime', 'Jobs', 'number(0,30)', 'Reboot delay', 'The amount of delay in minutes between scheduling a reboot and the actual reboot', '5');
|
('jobs.reboottime', 'Jobs', 'number(0,30)', 'Reboot delay', 'The amount of delay in minutes between scheduling a reboot and the actual reboot', '5');
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ foreach ($results as $result) {
|
|||||||
$nosave = false;
|
$nosave = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_configvalue('dbclean.lastrun') + (60 * 60 * 24 * get_configvalue('dbclean.delay')) < time()) clean_database();
|
if ((get_configvalue('dbclean.enabled') == 'true') && (get_configvalue('dbclean.lastrun') + (60 * 60 * 24 * get_configvalue('dbclean.delay')) < time())) clean_database();
|
||||||
|
|
||||||
unlink('/tmp/webcron.lock');
|
unlink('/tmp/webcron.lock');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user