Ensure we process all pending announcements.
authorCMDR furrycat <elite@furrycat.net>
Fri, 7 Oct 2016 06:31:10 +0000 (07:31 +0100)
committerCMDR furrycat <elite@furrycat.net>
Fri, 7 Oct 2016 06:31:10 +0000 (07:31 +0100)
bot.py

diff --git a/bot.py b/bot.py
index c30a3a8..14254f8 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -1172,8 +1172,8 @@ def announce(announcement):
 def do_announcements():
   waittime = 60
   while True:
-    now = time.time()
-    for announcement in db.get_announcements(client):
+    # Convert to list because we will be sharing the cursor.
+    for announcement in list(db.get_announcements(client)):
       yield from announce(announcement)
     yield from asyncio.sleep(waittime)