fix snatch time field not increase

This commit is contained in:
xiaomlove
2022-04-08 22:26:10 +08:00
parent 9445ef98ac
commit 7e24dad00c
2 changed files with 8 additions and 3 deletions

View File

@@ -135,8 +135,8 @@ class Test extends Command
// $model = \App\Models\TorrentSecret::query()->where('id', 1)->first();
// \Nexus\Database\NexusDB::cache_put($key, $model);
$r = User::query()->first();
dd($r->donoruntil);
$peer = new Peer(['last_action' => '2022-04-08 22:20:14']);
}

View File

@@ -85,11 +85,16 @@ class TrackerRepository extends BaseRepository
$this->checkCheater($torrent, $dataTraffic, $user, $peerSelf);
}
$this->updatePeer($peerSelf, $queries);
/**
* Note: Must update snatch first, otherwise peer last_action already change
*/
$snatch = $this->updateSnatch($peerSelf, $queries, $dataTraffic);
if ($queries['event'] == 'completed') {
$this->handleHitAndRun($user, $torrent, $snatch);
}
$this->updatePeer($peerSelf, $queries);
$this->updateTorrent($torrent, $queries);
if ($dataTraffic['uploaded_increment_for_user'] > 0) {