27 lines
802 B
Python
27 lines
802 B
Python
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
|
|
from apscheduler.schedulers.blocking import BlockingScheduler
|
|
|
|
from link_validator_executor import start_link_validation
|
|
|
|
|
|
def start_check_results_job(sched):
|
|
sched.add_job(start_link_validation, 'cron', day_of_week='mon-sun', hour='14',
|
|
minute='10',
|
|
misfire_grace_time=10,
|
|
second='10', timezone='Europe/Paris', max_instances=1, args=[])
|
|
|
|
|
|
def config_and_start_jobs():
|
|
executors = {
|
|
'default': ThreadPoolExecutor(1),
|
|
'processpool': ProcessPoolExecutor(1)
|
|
}
|
|
sched = BlockingScheduler(executors=executors)
|
|
start_check_results_job(sched)
|
|
sched.print_jobs()
|
|
sched.start()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
config_and_start_jobs()
|