Refactoring cleanup tasks to update user seed time and seed comments etc.

This commit is contained in:
xiaomlove
2023-07-10 02:33:27 +08:00
parent e66e90fde4
commit 52f62a1c28
7 changed files with 118 additions and 167 deletions
+4 -1
View File
@@ -738,7 +738,10 @@ if(count($USERUPDATESET) && $userid)
sql_query($sql);
do_log("[ANNOUNCE_UPDATE_USER], $sql");
}
\App\Repositories\CleanupRepository::recordBatch($redis, $userid, $torrentid);
$lockKey = sprintf("record_batch_lock:%s:%s", $userid, $torrentid);
if ($redis->set($lockKey, TIMENOW, ['nx', 'ex' => $autoclean_interval_one])) {
\App\Repositories\CleanupRepository::recordBatch($redis, $userid, $torrentid);
}
do_action('announced', $torrent, $az, $_REQUEST);
benc_resp($rep_dict);
?>