diff --git a/fetch.backend_proto.py b/fetch.backend_proto.py index 722dce3..3963504 100644 --- a/fetch.backend_proto.py +++ b/fetch.backend_proto.py @@ -4,8 +4,6 @@ from main import read_file_proto_x_stop, r import logging import os -sched = BlockingScheduler() -sched.add_job(rutina_principal, 'interval', seconds=int(os.environ.get('INTERVAL'))) #will do the print_t work for every 30 seconds def rutina_principal(): print(datetime.now(tz)) @@ -41,6 +39,10 @@ def download_file_backend(): return { 'name': nombre_archivo, 'content': response.content } return None +sched = BlockingScheduler() +sched.add_job(rutina_principal, 'interval', seconds=int(os.environ.get('INTERVAL'))) #will do the print_t work for every 30 seconds + + if __name__ == '__main__': init_db(db, engine) sched.start()