Fixed peer status updating.

This commit is contained in:
flash 2023-10-06 23:12:20 +00:00
parent 338881b7ec
commit 9c4cbcfff7

View file

@ -89,15 +89,15 @@ class TorrentPeers {
int $bytesRemaining
): void {
$stmt = $this->cache->get('UPDATE ser_torrents_peers SET peer_address = INET6_ATON(?), peer_port = ?, peer_updated = NOW(), peer_expires = NOW() + INTERVAL ? SECOND, peer_agent = ?, peer_uploaded = ?, peer_downloaded = ?, peer_left = ? WHERE torrent_id = ? AND peer_id = ?');
$stmt->addParameter(1, $torrentInfo instanceof TorrentInfo ? $torrentInfo->getId() : $torrentInfo);
$stmt->addParameter(2, $peerInfo instanceof TorrentPeerInfo ? $peerInfo->getId() : $peerInfo);
$stmt->addParameter(3, $remoteAddr);
$stmt->addParameter(4, $remotePort);
$stmt->addParameter(5, $interval);
$stmt->addParameter(6, $peerAgent);
$stmt->addParameter(7, $bytesUploaded);
$stmt->addParameter(8, $bytesDownloaded);
$stmt->addParameter(9, $bytesRemaining);
$stmt->addParameter(1, $remoteAddr);
$stmt->addParameter(2, $remotePort);
$stmt->addParameter(3, $interval);
$stmt->addParameter(4, $peerAgent);
$stmt->addParameter(5, $bytesUploaded);
$stmt->addParameter(6, $bytesDownloaded);
$stmt->addParameter(7, $bytesRemaining);
$stmt->addParameter(8, $torrentInfo instanceof TorrentInfo ? $torrentInfo->getId() : $torrentInfo);
$stmt->addParameter(9, $peerInfo instanceof TorrentPeerInfo ? $peerInfo->getId() : $peerInfo);
$stmt->execute();
}