add torrent pos_state_until

This commit is contained in:
xiaomlove
2022-09-17 18:55:26 +08:00
parent fedc67ad5e
commit 1a0ad86b32
10 changed files with 160 additions and 4 deletions

View File

@@ -462,6 +462,28 @@ function docleanup($forceAll = 0, $printProgress = false) {
if ($printProgress) {
printProgress($log);
}
//expire torrent sticky
$toBeExpirePosStates = [
\App\Models\Torrent::POS_STATE_STICKY_FIRST,
\App\Models\Torrent::POS_STATE_STICKY_SECOND,
];
$update = [
'pos_state' => \App\Models\Torrent::POS_STATE_STICKY_NONE,
'pos_state_until' => null,
];
\App\Models\Torrent::query()
->whereIn('pos_state', $toBeExpirePosStates)
->whereNotNull('pos_state_until')
->where('pos_state_until', '<', now())
->update($update);
$log = "expire torrent pos state";
do_log($log);
if ($printProgress) {
printProgress($log);
}
//automatically pick hot
if ($hotdays_torrent)
{