Python Forum
How can i use max_instances in apscheduler
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can i use max_instances in apscheduler
#1
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.
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()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  send repeated messages with apscheduler pylab 1 1,868 Jan-04-2020, 08:43 PM
Last Post: snippsat
  Help with apscheduler brakow87 5 6,006 Oct-21-2018, 07:16 PM
Last Post: buran
  How to convert Schedule to APScheduler module? penguin9 2 3,727 May-03-2018, 12:44 PM
Last Post: penguin9

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020