improe announce

This commit is contained in:
xiaomlove
2023-05-30 03:02:49 +08:00
parent 77d671b3e6
commit 29cbe19c21
6 changed files with 64 additions and 12 deletions

View File

@@ -97,7 +97,9 @@ class Test extends Command
*/
public function handle()
{
$r = NexusDB::cache_get("user_all_permissions:10001");
$authkey = "12|52|abc";
$subAuthkey = substr($authkey, 0, strrpos($authkey, "|"));
$r = $subAuthkey;
dd($r);
}

View File

@@ -381,12 +381,14 @@ class TorrentRepository extends BaseRepository
private function getTrackerReportAuthKeySecret($id, $uid, $initializeIfNotExists = false)
{
$secret = TorrentSecret::query()
->where('uid', $uid)
->whereIn('torrent_id', [0, $id])
->orderBy('torrent_id', 'desc')
->orderBy('id', 'desc')
->first();
$secret = NexusDB::remember("torrent_secret_{$uid}_{$id}", 3600, function () use ($id, $uid) {
return TorrentSecret::query()
->where('uid', $uid)
->whereIn('torrent_id', [0, $id])
->orderBy('torrent_id', 'desc')
->orderBy('id', 'desc')
->first();
});
if ($secret) {
return $secret->secret;