I'm trying to stop the apscheduler from running on by removing the job
and shutting it down completely!
None of them is working, my function expire_data
still gets triggered
def process_bin(value):
print "Stored:",pastebin.value
print "Will expire in",pastebin_duration.value,"seconds!"
if pastebin_duration>=0:
scheduler = BlockingScheduler()
job=scheduler.add_job(expire_data, 'interval', seconds=5)
scheduler.start()
job.remove()
scheduler.shutdown()
def expire_data():
print "Delete data!"
How can I stop it?
You are using a
BlockingScheduler
, therefore you can't.