chiark / gitweb /
Add +/-0.5s to chat log poll times to make behaviour less clumpy
[ypp-sc-tools.db-test.git] / yoweb-scrape
index 3d9e857beaabe7d4622f3185cd6d4ff0c6c43350..e3a7c8c19c7b97f5e7c1e7dbb30f3418b101859a 100755 (executable)
@@ -149,6 +149,8 @@ class Fetcher:
                                need_wait = max(need_wait, min_age - age)
                        min_age += 3
                        min_age *= 1.25
+               if need_wait > 0:
+                       need_wait += random.random() - 0.5
                return need_wait
 
        def _rate_limit_cache_clean(self, now):
@@ -972,7 +974,7 @@ def do_track_chat_log(args, bu):
                track.catchup()
                if track.changed():
                        print track
-               sleep(1)
+               sleep(0.5 + 0.5 * random.random())
 
 #----- ship management aid -----