improve peer count update

This commit is contained in:
xiaomlove
2022-04-27 15:29:06 +08:00
parent d002156f78
commit 73554a2443
4 changed files with 16 additions and 5 deletions
+2 -1
View File
@@ -758,11 +758,12 @@ class TrackerRepository extends BaseRepository
*
* @param Torrent $torrent
* @param $queries
* @param Peer $peer
* @param bool $isPeerExists
*/
private function updateTorrent(Torrent $torrent, $queries, bool $isPeerExists)
{
if (!empty($queries['event'])) {
if (!empty($queries['event']) || !$isPeerExists) {
$torrent->seeders = Peer::query()
->where('torrent', $torrent->id)
->where('to_go', '=',0)