Skip to content

Commit

Permalink
Quicker updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dmzoneill committed May 18, 2024
1 parent 398b5d2 commit 4b49da5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions d_fake_seeder/lib/torrent/torrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,24 @@ def update_torrent_worker(self):
try:
fetched = False
count = 5

GLib.idle_add(self.update_torrent_callback)
time.sleep(random.uniform(1.0, self.settings.tickspeed))

while fetched is False and count != 0:
logger.debug(
"Requesting seeder information",
extra={"class_name": self.__class__.__name__},
)
fetched = self.seeder.load_peers()
if fetched is False:
print("sleeping 30")
time.sleep(30)
print("sleeping 3")
time.sleep(3)
count -= 1
if count == 0:
self.active = False

ticker = 0.0
GLib.idle_add(self.update_torrent_callback)
time.sleep(random.uniform(1.0, self.settings.tickspeed))

while not self.torrent_worker_stop_event.is_set():
if ticker == self.settings.tickspeed and self.active:
Expand Down

0 comments on commit 4b49da5

Please sign in to comment.