add booking job to scheduler
This commit is contained in:
+10
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user