Added sched module for the loop

This commit is contained in:
Antonio de la Rosa 2021-07-09 19:48:22 +02:00
parent 7bf7043bc5
commit a3011a1f1a

View file

@ -13,6 +13,7 @@ from pathlib import Path
import signal import signal
from socket import getfqdn from socket import getfqdn
import argparse import argparse
from paramecio.citoplasma import datetime
import sched, time import sched, time
@ -153,6 +154,19 @@ def run_start(sc):
def start(): def start():
#Wait seconds to
while True:
sleep(2)
sec=datetime.now()
if sec[12:13]=='0':
break
print('Begin scheduler monit in %s...' % datetime.now())
s=sched.scheduler(time.time, time.sleep) s=sched.scheduler(time.time, time.sleep)
run_start(s) run_start(s)
s.run() s.run()