return [(os.path.splitext(filename)[0], os.path.join(rootdir, filename)) for rootdir, dirnames, filenames in os.walk(rootdir) for filename in filenames if filename.endswith(suffix)] import hashlib schedmd5 = {} services_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "services") from apscheduler.scheduler import Scheduler from apscheduler import threadpool sched = Scheduler(daemonic=False) sched._threadpool = threadpool.ThreadPool(core_threads=10, max_threads=200, keepalive=10) sched.start() # reset jobs every 4h # (5 sec +) 12 + 60 * 4 = 2880 # set -1 to disable reloading timer2reload = -1 # 2880 timer = timer2reload #=========================== #START THE ISTSOS SCHEDULER #=========================== @sched.interval_schedule(seconds=5) def istsos_job():