From 4f519a9f5502f6f4289a9815a454f042fa2ab32a Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Mon, 28 Aug 2023 23:29:27 -0700 Subject: [PATCH] reduce amount of runs --- src/catchup.py | 3 ++- src/listen.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/catchup.py b/src/catchup.py index 0c15023..f7cef26 100644 --- a/src/catchup.py +++ b/src/catchup.py @@ -154,6 +154,7 @@ async def run(PROGRAM_ARGS): if safe_to_post_tweets: if await process_queue(): print("Finished processing queue") + return else: print('Posted no new tweets; we\'re caught up!') return @@ -178,4 +179,4 @@ async def run(PROGRAM_ARGS): await queue_loop() except KeyboardInterrupt: print('Interrupt received. Ending catchup mode...') - return False \ No newline at end of file + return False diff --git a/src/listen.py b/src/listen.py index 4e28a8e..9df17fb 100644 --- a/src/listen.py +++ b/src/listen.py @@ -11,8 +11,8 @@ def run(PROGRAM_ARGS): while True: try: asyncio.run(catchup.run(PROGRAM_ARGS)) - print('Sleeping for 10 minutes...') - sleep(60*10) # run every 10 minutes + print('Sleeping for 60 minutes...') + sleep(60*60) # run every hour except KeyboardInterrupt: print('Interrupt signal received. Exiting listen mode.') print(f'errors encountered throughout session.')