-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscheduler.py
27 lines (22 loc) · 876 Bytes
/
scheduler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from time import time
from hmgru.AutocallController import consultaDatos, reportar
import schedule
import threading
import time
schedule.every().monday.at("07:00:00").do(consultaDatos)
schedule.every().tuesday.at("07:00:00").do(consultaDatos)
schedule.every().wednesday.at("11:50:00").do(consultaDatos)
schedule.every().thursday.at("07:00:00").do(consultaDatos)
schedule.every().friday.at("07:00:00").do(consultaDatos)
schedule.every().monday.at("18:00:00").do(reportar)
schedule.every().tuesday.at("18:00:00").do(reportar)
schedule.every().wednesday.at("18:00:00").do(reportar)
schedule.every().thursday.at("18:00:00").do(reportar)
schedule.every().friday.at("18:00:00").do(reportar)
def reloj():
while True:
schedule.run_pending()
time.sleep(1)
def initThread():
timer = threading.Thread(target=reloj)
timer.start()