Code in shutdown_handler
is never executed at shutdown. If a database connection is left open at time of shutdown/restart and --dev
is given, a process is left hanging, preventing further use of the port.
For example, no message is printed upon receiving SIGINT:
from robyn import Robyn
app = Robyn(__file__)
@app.get('/')
async def index(request):
return 'hello world'
@app.startup_handler
async def startup_handler():
print('Starting up...')
@app.shutdown_handler
async def shutdown_handler():
print('Shutting down...')
app.start(port=8081)
Linux
python --version
)3.12
latest
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too