reset the time to 6pm
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user