isReAnnounce cache add prefix

This commit is contained in:
xiaomlove
2023-04-30 11:48:43 +08:00
parent 7ee59518c2
commit 2844bbf729
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.2');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-04-29');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-04-30');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+3 -3
View File
@@ -157,8 +157,8 @@ if (
&& isset($torrent['price'])
&& $torrent['price'] > 0
&& $torrent['owner'] != $userid
&& get_setting("torrent.paid_torrent_enabled") == "yes")
{
&& get_setting("torrent.paid_torrent_enabled") == "yes"
) {
$hasBuy = \App\Models\TorrentBuyLog::query()->where('uid', $userid)->where('torrent_id', $torrent['id'])->exists();
if (!$hasBuy) {
if ($az['seedbonus'] < $torrent['price']) {
@@ -222,7 +222,7 @@ foreach(['info_hash', 'passkey', 'peer_id'] as $lockField) {
$lockParams[$lockField] = $_GET[$lockField];
}
$lockString = http_build_query($lockParams);
$lockKey = md5($lockString);
$lockKey = "isReAnnounce:" . md5($lockString);
$log .= ", [CHECK_RE_ANNOUNCE], lockString: $lockString, lockKey: $lockKey";
$redis = $Cache->getRedis();
if (!$redis->set($lockKey, TIMENOW, ['nx', 'ex' => 5])) {