gtfsrt_concepcion/sync.py

19 lines
461 B
Python
Raw Normal View History

2023-09-16 12:07:33 -03:00
# coding: utf-8
from updater.model.feed import init_db, db, engine
from updater.main import sync_db, log
import time
if __name__ == '__main__':
init_db(db, engine)
doki = int(time.time()) + 600
while True:
if not sync_db():
i = int(time.time())
if i >= doki:
doki = i + 600
log.info('Heartbeat')
time.sleep(20)
else:
doki = int(time.time()) + 600