mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
lefttime -> lifetime
This commit is contained in:
@@ -39,7 +39,7 @@ class CleanupRepository extends BaseRepository
|
|||||||
{
|
{
|
||||||
$args = [
|
$args = [
|
||||||
self::USER_SEED_BONUS_BATCH_KEY, self::USER_SEEDING_LEECHING_TIME_BATCH_KEY, self::TORRENT_SEEDERS_ETC_BATCH_KEY,
|
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);
|
$result = $redis->eval(self::getAddRecordLuaScript(), $args, 3);
|
||||||
$err = $redis->getLastError();
|
$err = $redis->getLastError();
|
||||||
@@ -82,10 +82,10 @@ class CleanupRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
//update the batch key
|
//update the batch key
|
||||||
$newBatch = $batchKey . ":" . self::getHashKeySuffix();
|
$newBatch = $batchKey . ":" . self::getHashKeySuffix();
|
||||||
$leftTime = self::getCacheKeyLeftTime();
|
$lifeTime = self::getCacheKeyLifeTime();
|
||||||
$redis->set($batchKey, $newBatch, ['ex' => $leftTime]);
|
$redis->set($batchKey, $newBatch, ['ex' => $lifeTime]);
|
||||||
$redis->hSetNx($newBatch, -1, 1);
|
$redis->hSetNx($newBatch, -1, 1);
|
||||||
$redis->expire($newBatch, $leftTime);
|
$redis->expire($newBatch, $lifeTime);
|
||||||
|
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
@@ -201,7 +201,7 @@ LUA;
|
|||||||
return floor($base + $offset);
|
return floor($base + $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getCacheKeyLeftTime(): int
|
private static function getCacheKeyLifeTime(): int
|
||||||
{
|
{
|
||||||
$value = get_setting("main.autoclean_interval_three");
|
$value = get_setting("main.autoclean_interval_three");
|
||||||
return intval($value) + 600;
|
return intval($value) + 600;
|
||||||
|
|||||||
Reference in New Issue
Block a user