search

Home  >  Q&A  >  body text

python bottle跑起来以后,定时执行的任务为什么每次都重复(多)执行一次?


sched = BackgroundScheduler()
sched.add_job(getDataListFromBKY, 'interval', seconds=15) # 采集时间间隔
sched.start()

@app.route('/', method='GET')
def query_data():
    for key, value in request.params.items():
        if key == 'fun' and value == 'query':
            print(key + ' : ' + value)
            dic = query_content()
            print(dic)
            return dic

app.run(host='localhost',port=8080, debug=True,reloader=True, server='gunicorn', workers=4)
怪我咯怪我咯2777 days ago920

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-18 10:24:34

    Check if getDataListFromBKY is called once in another module? ?

    reply
    0
  • Cancelreply