From 4627b0739643bb738d8c90f8b9b085b009422f3b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 6 Apr 2021 15:14:49 -0700 Subject: [PATCH] zephyr: Decrease update frequency of sync-public-streams. --- zulip/integrations/zephyr/sync-public-streams | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zulip/integrations/zephyr/sync-public-streams b/zulip/integrations/zephyr/sync-public-streams index ac96cad..10a923c 100755 --- a/zulip/integrations/zephyr/sync-public-streams +++ b/zulip/integrations/zephyr/sync-public-streams @@ -60,7 +60,14 @@ if __name__ == "__main__": zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1") while True: - time.sleep(15) + # Sync every 5 minutes because this makes a very large network + # request, due to Zephyr users who subscribe to 10K+ class + # names generated by a script. + # + # This delay means we won't subscribe to new Zephyr classes + # until 5 minutes after they are created in Zulip; this isn't + # great but an acceptable tradeoff. + time.sleep(300) public_streams = fetch_public_streams() if public_streams is None: continue