>  Q&A  >  본문

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)
怪我咯怪我咯2713일 전860

모든 응답(1)나는 대답할 것이다

  • 天蓬老师

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

    다른 모듈에서 getDataListFromBKY가 한 번 호출되는지 확인하세요. ?

    회신하다
    0
  • 취소회신하다