mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
add torrent pos_state_until
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user