X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdbclean.php;h=1e1dd908290ec045cd8166b7b0565210116e243f;hb=478e363967165980eb826e8d109dd15770e2c784;hp=024b845f7dc736a8a8fd3e0fd066676ff56a56ef;hpb=c9ea18ce7499cc70b16e27050c118e1f5e03831c;p=friendica.git diff --git a/include/dbclean.php b/include/dbclean.php index 024b845f7d..1e1dd90829 100644 --- a/include/dbclean.php +++ b/include/dbclean.php @@ -5,6 +5,7 @@ */ use Friendica\Core\Config; +use Friendica\Core\Worker; function dbclean_run(&$argv, &$argc) { if (!Config::get('system', 'dbclean', false)) { @@ -24,8 +25,8 @@ function dbclean_run(&$argv, &$argc) { for ($i = 1; $i <= 9; $i++) { // Execute the background script for a step when it isn't finished. // Execute step 8 and 9 only when $days is defined. - if (!Config::get('system', 'finished-dbclean-'.$i, false) AND (($i < 8) OR ($days > 0))) { - proc_run(PRIORITY_LOW, 'include/dbclean.php', $i); + if (!Config::get('system', 'finished-dbclean-'.$i, false) && (($i < 8) || ($days > 0))) { + Worker::add(PRIORITY_LOW, 'dbclean', $i); } } } else { @@ -35,6 +36,19 @@ function dbclean_run(&$argv, &$argc) { /** * @brief Remove orphaned database entries + * @param integer $stage What should be deleted? + * + * Values for $stage: + * ------------------ + * 1: Old global item entries from item table without user copy. + * 2: Items without parents. + * 3: Orphaned data from thread table. + * 4: Orphaned data from notify table. + * 5: Orphaned data from notify-threads table. + * 6: Orphaned data from sign table. + * 7: Orphaned data from term table. + * 8: Expired threads. + * 9: Old global item entries from expired threads */ function remove_orphans($stage = 0) { global $db; @@ -283,7 +297,7 @@ function remove_orphans($stage = 0) { } // Call it again if not all entries were purged - if (($stage != 0) AND ($count > 0)) { - proc_run(PRIORITY_MEDIUM, 'include/dbclean.php'); + if (($stage != 0) && ($count > 0)) { + Worker::add(PRIORITY_MEDIUM, 'dbclean'); } }