- if (Config::get("system", "worker") AND ($stage == 0)) {
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 1);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 2);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 3);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 4);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 5);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 6);
- proc_run(PRIORITY_LOW, 'include/dbclean.php', 7);
+ if ($stage == 0) {
+ for ($i = 1; $i <= 7; $i++) {
+ if (!Config::get('system', 'finished-dbclean-'.$i)) {
+ proc_run(PRIORITY_LOW, 'include/dbclean.php', $i);
+ }
+ }