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
When I start the scheduler, it runs stable for some time, but withouht any msg, the after_success(fuc) stop running.
Only the periodic timer functions are executed.
scheduler=Grouper()
@scheduler.task(minutely,execution="main", )defcheck_starting_condition():
ifcheck_first() andcheck_second():
logging.info(f"Check starting condition passed!")
return"OK"else:
raiseException("Im not allowed to run the Taks")
@scheduler.task(after_fail(check_starting_condition),execution="main")deffailed_check():
logging.info("Der report_check failed!")
@scheduler.task(after_success(check_starting_condition),execution="async")asyncdefmain_exc_function(
):
# an async function call with aiohttpreturnsome_stuff
I integrated it along with Fastapi
classServer(uvicorn.Server):
"""Customized uvicorn.Server Uvicorn server overrides signals and we need to include Rocketry to the signals."""defhandle_exit(self, sig: int, frame) ->None:
app_scheduler.session.shut_down()
returnsuper().handle_exit(sig, frame)
asyncdefrun():
server=Server(config=uvicorn.Config(
app,
loop="asyncio",
host=server_settings.SERVER_HOST,
port=server_settings.SERVER_PORT,
reload=server_settings.SERVER_RELOAD,
workers=server_settings.SERVER_WORKER,
timeout_keep_alive=server_settings.SERVER_TIME_OUT,
access_log=False))
api=asyncio.create_task(server.serve())
sched=asyncio.create_task(app_scheduler.serve())
awaitasyncio.wait([sched, api])
if__name__=="__main__":
asyncio.run(run())
The text was updated successfully, but these errors were encountered:
I have now tested the scheduler for several days. The problem only occurs when I use the SQL repo.
I tried to set the SQLalchemy engine to log the queries via echo=true. Unfortunately I get the error message here
"AttributeError: 'scheduler_log' object has no attribute '_sa_instance_state'"
see logs.txt logs.txt
After using the logs from the DB, I noticed that despite the setting of the id_field with the config:
When I start the scheduler, it runs stable for some time, but withouht any msg, the after_success(fuc) stop running.
Only the periodic timer functions are executed.
Screenshots from the DB log
The Scheduler implementation:
The Task implementation
I integrated it along with Fastapi
The text was updated successfully, but these errors were encountered: