def background_scheduler(): schedule.every(5).seconds.do(job) while 1: schedule.run_pending() time.sleep(1)
I’m currently using the scheduler module for a project I’m working on, It supposed to run in the background and when I exit the terminal and come back it’s running as a process but this bit of code just doesn’t want to run. when I run it in the terminal it runs fine but only when I send it to the background time.sleep refuses to work. any idea why? I also assigned a thread to this function if that matters.