Jul-21-2019, 11:17 PM
Hi, guys
I am working with 3 scripts. The first one does a request, save the data from the request and write in a csv file.
The second one is a flask app that recieves that csv and display it in a table.
The third is a clock that repeats the first script from time to time.
My problem is in the third script... i am using heroku and i cant use scheduler ... my current code is like this.
I am working with 3 scripts. The first one does a request, save the data from the request and write in a csv file.
The second one is a flask app that recieves that csv and display it in a table.
The third is a clock that repeats the first script from time to time.
My problem is in the third script... i am using heroku and i cant use scheduler ... my current code is like this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from apscheduler.schedulers.blocking import BlockingScheduler from trainsScript import * sched = BlockingScheduler() @sched .scheduled_job(trigger = 'interval' , seconds = 3 ,max_instances = 15 ) def trains(): try : data = list (getRequest()) getTrain(data) print ( 'updating 5 seconds' ) except : print ( 'ERROR BRUNO' ) sched.start() |