Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedule only runs once? #617

Open
RWRmrfrog opened this issue Mar 23, 2024 · 2 comments
Open

Schedule only runs once? #617

RWRmrfrog opened this issue Mar 23, 2024 · 2 comments

Comments

@RWRmrfrog
Copy link

RWRmrfrog commented Mar 23, 2024

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)
@empve
Copy link

empve commented Apr 14, 2024

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

@empve
Copy link

empve commented Apr 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants