mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-26 05:17:22 +08:00
fix snatch time field not increase
This commit is contained in:
@@ -135,8 +135,8 @@ class Test extends Command
|
|||||||
// $model = \App\Models\TorrentSecret::query()->where('id', 1)->first();
|
// $model = \App\Models\TorrentSecret::query()->where('id', 1)->first();
|
||||||
// \Nexus\Database\NexusDB::cache_put($key, $model);
|
// \Nexus\Database\NexusDB::cache_put($key, $model);
|
||||||
|
|
||||||
$r = User::query()->first();
|
$peer = new Peer(['last_action' => '2022-04-08 22:20:14']);
|
||||||
dd($r->donoruntil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -85,11 +85,16 @@ class TrackerRepository extends BaseRepository
|
|||||||
$this->checkCheater($torrent, $dataTraffic, $user, $peerSelf);
|
$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);
|
$snatch = $this->updateSnatch($peerSelf, $queries, $dataTraffic);
|
||||||
if ($queries['event'] == 'completed') {
|
if ($queries['event'] == 'completed') {
|
||||||
$this->handleHitAndRun($user, $torrent, $snatch);
|
$this->handleHitAndRun($user, $torrent, $snatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->updatePeer($peerSelf, $queries);
|
||||||
|
|
||||||
$this->updateTorrent($torrent, $queries);
|
$this->updateTorrent($torrent, $queries);
|
||||||
|
|
||||||
if ($dataTraffic['uploaded_increment_for_user'] > 0) {
|
if ($dataTraffic['uploaded_increment_for_user'] > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user