I have a periodic job. Since its upgrades are needed and I do not want to stop the main code, I wish I could modify/update the job on the fly. I'll demonstrate by simple example.
Main script:
from apscheduler.schedulers.blocking import BlockingScheduler
from my_job_func import my_job
if __name__ == '__main__':
scheduler = BlockingScheduler()
scheduler.add_job(my_job, 'interval', seconds=3)
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
pass
job to be modified on-the-fly in file my_job_func.py:
def my_job():
print('Make some changes!!')
So, is it somehow possible to modify or update my_job() on-the-fly without stopping the main script?