dht_crawler: fix last_seen update

This commit is contained in:
Victor Shyba 2022-06-11 21:11:37 -03:00 committed by Victor Shyba
parent 965389b759
commit 29c2d5715d

View file

@ -149,7 +149,7 @@ class Crawler:
to_peer_id=peer_id) to_peer_id=peer_id)
for peer_id in db_peer_ids for peer_id in db_peer_ids
} }
self.db.query(DHTPeer).filter(DHTPeer.node_id.in_(set(db_peer_ids))).update( self.db.query(DHTPeer).filter(DHTPeer.peer_id.in_(set(db_peer_ids))).update(
{DHTPeer.last_seen: datetime.datetime.utcnow()}) {DHTPeer.last_seen: datetime.datetime.utcnow()})
self.db.query(DHTConnection).filter(DHTConnection.from_peer_id == target_peer_id).delete() self.db.query(DHTConnection).filter(DHTConnection.from_peer_id == target_peer_id).delete()
self.db.add_all(connections) self.db.add_all(connections)