Skip to content

Commit

Permalink
lefttime -> lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Jul 26, 2023
1 parent f1da984 commit 2c3b36f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Repositories/CleanupRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function recordBatch(\Redis $redis, $uid, $torrentId)
{
$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();
Expand Down Expand Up @@ -82,10 +82,10 @@ private static function runBatchJob($batchKey, $requestId)
}
//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;
Expand Down Expand Up @@ -201,7 +201,7 @@ private static function getDelay(int $taskIndex, int $length, int $page): float
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;
Expand Down

0 comments on commit 2c3b36f

Please sign in to comment.