I would like to have my main task fire at 6am everyday. but for testing purposes I set the interval to 5 seconds. The problem is it doesn't seem to ever fire. I have a break point in the maintask method that is never reached and nothing gets printed to the console. I am assuming it's not running.
ETA: my code gets to scheduler.start() where is stops because it is blocking. it should start my maintask in 5 seconds but it never does.
python version is 2.7 apscheduler version is 3.0
I have run it on windows and Debian same result.
Here is my code.
from apscheduler.schedulers.blocking import BlockingScheduler
import datetime
def maintask():
print("blah")
def main():
scheduler = BlockingScheduler()
print("Scheduling Tasks")
start_time = (datetime.datetime.now()).replace(hour=6, minute=0, second=0, microsecond=0)
scheduler.scheduled_job(maintask, 'interval', id="MainTaskid", name="mainTask", start_date=start_time, seconds=5, misfire_grace_time=60)
print("Tasks Scheduled")
print("Running Tasks")
scheduler.start()
print("Good Bye")
return 0
if __name__ == "__main__":
main()