add booking job to scheduler

This commit is contained in:
2022-07-25 09:44:37 +02:00
parent 67a98fc248
commit 418699635e
2 changed files with 11 additions and 5 deletions
+10 -4
View File
@@ -1,18 +1,24 @@
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
from apscheduler.schedulers.blocking import BlockingScheduler
from main import start_book
from src.check_results import check_results
from src.pojo.ModeEnum import ModeEnum
def check_results_job():
check_results()
def start_book_appointment():
start_book(901, 1200, store_choose_state=1, mode=ModeEnum.AUTOMATIC, headless=True)
def start_check_results_job(sched):
# sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sat', hour='10',
# minute='30',
# misfire_grace_time=10,
# second='0', timezone='Europe/Paris', max_instances=1)
sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sat', hour='10',
minute='30',
misfire_grace_time=10,
second='0', timezone='Europe/Paris', max_instances=1)
sched.add_job(check_results, 'cron', day_of_week='mon-sat', hour='20',
minute='55',
misfire_grace_time=10,