update batch key suffix

This commit is contained in:
xiaomlove
2023-07-10 02:41:38 +08:00
parent 52f62a1c28
commit 2bccfe58c8
+3 -3
View File
@@ -36,7 +36,7 @@ class CleanupRepository extends BaseRepository
return; return;
} }
//update the batch key //update the batch key
$redis->set($batchKey, $batchKey . self::getHashKeySuffix()); $redis->set($batchKey, $batchKey . ":" . self::getHashKeySuffix());
$count = match ($batchKey) { $count = match ($batchKey) {
self::USER_SEEDING_LEECHING_TIME_BATCH_KEY => self::updateUserLeechingSeedingTime($redis, $batch, $logPrefix), self::USER_SEEDING_LEECHING_TIME_BATCH_KEY => self::updateUserLeechingSeedingTime($redis, $batch, $logPrefix),
self::TORRENT_SEEDERS_ETC_BATCH_KEY => self::updateTorrentSeedersEtc($redis, $batch, $logPrefix), self::TORRENT_SEEDERS_ETC_BATCH_KEY => self::updateTorrentSeedersEtc($redis, $batch, $logPrefix),
@@ -150,7 +150,7 @@ for k, v in pairs(batchList) do
local batchKey = redis.call("GET", v) local batchKey = redis.call("GET", v)
local isBatchKeyNew = false local isBatchKeyNew = false
if batchKey == false then if batchKey == false then
batchKey = v .. ARGV[3] batchKey = v .. ":" .. ARGV[3]
redis.call("SET", v, batchKey, "EX", 2592000) redis.call("SET", v, batchKey, "EX", 2592000)
isBatchKeyNew = true isBatchKeyNew = true
end end
@@ -170,7 +170,7 @@ LUA;
private static function getHashKeySuffix(): string private static function getHashKeySuffix(): string
{ {
return ":" . date('Ymd_His'); return date('Ymd_His');
} }
} }