reset the time to 6pm
This commit is contained in:
@@ -99,11 +99,11 @@ class SubStackTask:
|
|||||||
formatted_date = formatted_date.replace(en, fr)
|
formatted_date = formatted_date.replace(en, fr)
|
||||||
return formatted_date
|
return formatted_date
|
||||||
|
|
||||||
async def run_daily_at_11_am(self):
|
async def run_daily_at_6_am(self):
|
||||||
while True:
|
while True:
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
# Calculate the time until 6 AM next day
|
# 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()
|
sleep_seconds = (next_run - now).total_seconds()
|
||||||
|
|
||||||
while sleep_seconds > 0:
|
while sleep_seconds > 0:
|
||||||
@@ -257,7 +257,7 @@ async def main(login, password, account):
|
|||||||
task = SubStackTask(login, password, cookies_path, account, feeds)
|
task = SubStackTask(login, password, cookies_path, account, feeds)
|
||||||
|
|
||||||
LOG.info("Starting bot")
|
LOG.info("Starting bot")
|
||||||
await task.run_daily_at_11_am()
|
await task.run_daily_at_6_am()
|
||||||
#await task.daily_task()
|
#await task.daily_task()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user