zephyr: Decrease update frequency of sync-public-streams.

This commit is contained in:
Tim Abbott 2021-04-06 15:14:49 -07:00
parent 70f457f82a
commit 4627b07396

View file

@ -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