You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if name == 'main':
tl.start(block=False)
app.run(debug=True, host='0.0.0.0')
output
[2020-05-08 14:45:49,248] [timeloop] [INFO] Starting Timeloop..
[2020-05-08 14:45:49,248] [timeloop] [INFO] Registered job <function gatherAFXReport at 0x107d977d0>
[2020-05-08 14:45:49,248] [timeloop] [INFO] Timeloop now started. Jobs will run based on the interval set
Serving Flask app "test" (lazy loading)
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Restarting with stat
[2020-05-08 14:45:49,500] [timeloop] [INFO] Starting Timeloop..
[2020-05-08 14:45:49,501] [timeloop] [INFO] Registered job <function gatherAFXReport at 0x1075e77d0>
[2020-05-08 14:45:49,501] [timeloop] [INFO] Timeloop now started. Jobs will run based on the interval set
tl.start(block=Fasle)
the functions are exec ute twice when the block is false.
from timeloop import Timeloop
from datetime import timedelta, datetime
from flask import Flask, request
from flask_restful import Api
app = Flask(name)
api = Api(app)
tl = Timeloop()
@tl.job(interval=timedelta(seconds=5))
def gatherAFXReport():
try:
print("inside {}".format(datetime.now().strftime('%s')))
except Exception as e:
print(str(e))
if name == 'main':
tl.start(block=False)
app.run(debug=True, host='0.0.0.0')
output
[2020-05-08 14:45:49,248] [timeloop] [INFO] Starting Timeloop..
[2020-05-08 14:45:49,248] [timeloop] [INFO] Registered job <function gatherAFXReport at 0x107d977d0>
[2020-05-08 14:45:49,248] [timeloop] [INFO] Timeloop now started. Jobs will run based on the interval set
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
[2020-05-08 14:45:49,500] [timeloop] [INFO] Starting Timeloop..
[2020-05-08 14:45:49,501] [timeloop] [INFO] Registered job <function gatherAFXReport at 0x1075e77d0>
[2020-05-08 14:45:49,501] [timeloop] [INFO] Timeloop now started. Jobs will run based on the interval set
inside 1588929354
inside 1588929354
inside 1588929359
inside 1588929359
inside 1588929364
inside 1588929364
inside 1588929369
inside 1588929369
inside 1588929374
inside 1588929374
The text was updated successfully, but these errors were encountered: