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

@@ -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) {