From 2c3b36f997251d349a1977e4b8055ba5f3f6bef6 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 27 Jul 2023 02:47:20 +0800 Subject: [PATCH] lefttime -> lifetime --- app/Repositories/CleanupRepository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Repositories/CleanupRepository.php b/app/Repositories/CleanupRepository.php index 6ce3770a..a0ccd4bd 100644 --- a/app/Repositories/CleanupRepository.php +++ b/app/Repositories/CleanupRepository.php @@ -39,7 +39,7 @@ class CleanupRepository extends BaseRepository { $args = [ self::USER_SEED_BONUS_BATCH_KEY, self::USER_SEEDING_LEECHING_TIME_BATCH_KEY, self::TORRENT_SEEDERS_ETC_BATCH_KEY, - $uid, $uid, $torrentId, self::getHashKeySuffix(), self::getCacheKeyLeftTime() + $uid, $uid, $torrentId, self::getHashKeySuffix(), self::getCacheKeyLifeTime() ]; $result = $redis->eval(self::getAddRecordLuaScript(), $args, 3); $err = $redis->getLastError(); @@ -82,10 +82,10 @@ class CleanupRepository extends BaseRepository } //update the batch key $newBatch = $batchKey . ":" . self::getHashKeySuffix(); - $leftTime = self::getCacheKeyLeftTime(); - $redis->set($batchKey, $newBatch, ['ex' => $leftTime]); + $lifeTime = self::getCacheKeyLifeTime(); + $redis->set($batchKey, $newBatch, ['ex' => $lifeTime]); $redis->hSetNx($newBatch, -1, 1); - $redis->expire($newBatch, $leftTime); + $redis->expire($newBatch, $lifeTime); $count = 0; @@ -201,7 +201,7 @@ LUA; return floor($base + $offset); } - private static function getCacheKeyLeftTime(): int + private static function getCacheKeyLifeTime(): int { $value = get_setting("main.autoclean_interval_three"); return intval($value) + 600;