mirror of
https://github.com/friendica/friendica
synced 2025-05-05 22:24:11 +02:00
Define a maintenance window
This commit is contained in:
parent
5a685427ac
commit
7efd01880c
4 changed files with 67 additions and 2 deletions
|
@ -93,8 +93,8 @@ class Cron
|
|||
DI::config()->set('system', 'last_cron_hourly', time());
|
||||
}
|
||||
|
||||
// Daily cron calls
|
||||
if (DI::config()->get('system', 'last_cron_daily', 0) + 86400 < time()) {
|
||||
// Daily maintenance cron calls
|
||||
if (Worker::isInMaintenanceWindow(true)) {
|
||||
|
||||
Worker::add(PRIORITY_LOW, 'UpdateContactBirthdays');
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
@ -63,6 +64,11 @@ class ExpirePosts
|
|||
|
||||
$rows = DBA::affectedRows();
|
||||
Logger::notice('Deleted expired threads', ['result' => $ret, 'rows' => $rows]);
|
||||
|
||||
if (!Worker::isInMaintenanceWindow()) {
|
||||
Logger::notice('We are outside of the maintenance window, quitting');
|
||||
return;
|
||||
}
|
||||
} while ($rows >= $limit);
|
||||
}
|
||||
|
||||
|
@ -80,6 +86,11 @@ class ExpirePosts
|
|||
|
||||
$rows = DBA::affectedRows();
|
||||
Logger::notice('Deleted unclaimed public items', ['result' => $ret, 'rows' => $rows]);
|
||||
|
||||
if (!Worker::isInMaintenanceWindow()) {
|
||||
Logger::notice('We are outside of the maintenance window, quitting');
|
||||
return;
|
||||
}
|
||||
} while ($rows >= $limit);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue