reset the time to 6pm

This commit is contained in:
Gaël
2024-07-03 17:02:58 +02:00
parent f17cd92f90
commit e0127a0362

View File

@@ -99,11 +99,11 @@ class SubStackTask:
formatted_date = formatted_date.replace(en, fr)
return formatted_date
async def run_daily_at_11_am(self):
async def run_daily_at_6_am(self):
while True:
now = datetime.datetime.now()
# Calculate the time until 6 AM next day
next_run = (now + datetime.timedelta(days=1)).replace(hour=11, minute=0, second=0, microsecond=0)
next_run = (now + datetime.timedelta(days=1)).replace(hour=6, minute=5, second=0, microsecond=0)
sleep_seconds = (next_run - now).total_seconds()
while sleep_seconds > 0:
@@ -257,7 +257,7 @@ async def main(login, password, account):
task = SubStackTask(login, password, cookies_path, account, feeds)
LOG.info("Starting bot")
await task.run_daily_at_11_am()
await task.run_daily_at_6_am()
#await task.daily_task()