Schedule only runs once?
I have a feeling it's because I'm using multithreading, though I'm only using one schedule event. I don't really know what I'm doing wrong, but the event only runs once and then stops (instead of every three minutes or every day). I'm on windows 11 if that makes any difference. Putting the schedule code in another function doesn't help either.
###functions up here###
if __name__ == "__main__":
startThread = Thread(target=start).start()
userThread = Thread(target=userInput).start()
schedule.every(3).minutes.do(backup)
#schedule.every().day.at(backup_time).do(backup)
while True:
schedule.run_pending()
time.sleep(10)
I'm having the same issue. My job function uses the AWS Boto3 SDK, which, I think, uses threading/coroutine—maybe that is the issue. In the older version without calling boto3, the scheduler worked fine.
I'm also on Windows 11. Python 3.11.5
I can work around it by invoking the part interacting with AWS boto3 in a subprocess. But it makes the code significantly convoluted. I'm pretty sure it's a common use case among the users, so please investigate.
Thanks