allow posting specified tweets even if finished
This commit is contained in:
+2
-5
@@ -63,7 +63,7 @@ async def get_cross_tweets_online():
|
||||
|
||||
# return False = errored or we posted at least one ttweet
|
||||
# return True = we didn't post a single ttweet
|
||||
async def process_queue(priority_tweet_ids: list[str]=None) -> bool:
|
||||
async def process_queue() -> bool:
|
||||
global errored
|
||||
global scraper
|
||||
global queue
|
||||
@@ -137,7 +137,6 @@ async def run(PROGRAM_ARGS):
|
||||
print(f'Invalid tweet {id}!')
|
||||
continue
|
||||
|
||||
if i not in queue.finished_ttweets:
|
||||
posted = await TwAPI.instance.post_ttweet_by_id(i)
|
||||
if posted:
|
||||
queue.add_finished_tweet(i)
|
||||
@@ -145,8 +144,6 @@ async def run(PROGRAM_ARGS):
|
||||
await asyncio.sleep(60*5)
|
||||
else:
|
||||
print('Did not post tweet')
|
||||
else:
|
||||
print('Tweet was already finished')
|
||||
|
||||
print('Done processing specified tweets')
|
||||
PROGRAM_ARGS.post_id = None
|
||||
@@ -156,7 +153,7 @@ async def run(PROGRAM_ARGS):
|
||||
print(f'{queue.get_count()} cross-company tweets to announce.')
|
||||
try:
|
||||
if safe_to_post_tweets:
|
||||
if await process_queue(PROGRAM_ARGS.post_id):
|
||||
if await process_queue():
|
||||
print('Posted no new tweets; we\'re caught up!')
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user