Update request time in vectors_requested to not re-request too often

This commit is contained in:
Lee Miller 2024-09-08 02:18:21 +03:00
parent d106078dac
commit 1a2bcb7e33
Signed by: lee.miller
GPG Key ID: 4F97A5EA88F4AB63

View File

@ -431,13 +431,13 @@ class ConnectionBase(threading.Thread):
self.send_queue.put(message.GetData(pack)) self.send_queue.put(message.GetData(pack))
self.vectors_requested.update({ self.vectors_requested.update({
vector: time.time() for vector in pack vector: time.time() for vector in pack
if vector not in self.vectors_requested}) })
self.vectors_to_get.difference_update(pack) self.vectors_to_get.difference_update(pack)
else: else:
self.send_queue.put(message.GetData(self.vectors_to_get)) self.send_queue.put(message.GetData(self.vectors_to_get))
self.vectors_requested.update({ self.vectors_requested.update({
vector: time.time() for vector in self.vectors_to_get vector: time.time() for vector in self.vectors_to_get
if vector not in self.vectors_requested}) })
self.vectors_to_get.clear() self.vectors_to_get.clear()
if self.vectors_requested: if self.vectors_requested:
self.vectors_requested = { self.vectors_requested = {