Split cron tasks in several worker tasks

This commit is contained in:
Michael 2020-09-01 08:09:16 +00:00
parent dae3bcce0f
commit 4bb70d7593
6 changed files with 290 additions and 173 deletions

View file

@ -37,9 +37,6 @@ class ClearCache
// clear old cache
DI::cache()->clear();
if (DI::config()->get('system', 'optimize_tables')) {
DBA::e("OPTIMIZE TABLE `cache`");
}
// clear old item cache files
clear_cache();
@ -66,14 +63,8 @@ class ClearCache
// Delete the cached OEmbed entries that are older than three month
DBA::delete('oembed', ["`created` < NOW() - INTERVAL 3 MONTH"]);
if (DI::config()->get('system', 'optimize_tables')) {
DBA::e("OPTIMIZE TABLE `oembed`");
}
// Delete the cached "parse_url" entries that are older than three month
DBA::delete('parsed_url', ["`created` < NOW() - INTERVAL 3 MONTH"]);
if (DI::config()->get('system', 'optimize_tables')) {
DBA::e("OPTIMIZE TABLE `parsed_url`");
}
}
}