Added sched module for the loop
This commit is contained in:
parent
2ecfdbdf73
commit
1348eb04da
2 changed files with 13 additions and 3 deletions
|
|
@ -3,5 +3,5 @@ from pastafaristats import send_info_daemon
|
|||
url, group=send_info_daemon.load_config()
|
||||
|
||||
if __name__=='__main__':
|
||||
send_info_daemon.run(url)
|
||||
send_info_daemon.run(url, group)
|
||||
|
||||
|
|
|
|||
|
|
@ -141,9 +141,19 @@ def run_start(sc):
|
|||
|
||||
url, group=load_config()
|
||||
|
||||
run(url, group)
|
||||
sec=str(datetime.datetime.utcnow())
|
||||
|
||||
sc.enter(60, 1, run_start, (sc,))
|
||||
print('Send monitoring in %s...' % sec)
|
||||
|
||||
num_seconds=int(sec[17:19])
|
||||
|
||||
total_seconds=60
|
||||
|
||||
final_seconds=total_seconds-num_seconds
|
||||
|
||||
sc.enter(final_seconds, 1, run_start, (sc,))
|
||||
|
||||
run(url, group)
|
||||
|
||||
"""
|
||||
while True:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue