Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Uvicorn graceful shutdown. #209

Merged
merged 1 commit into from
May 14, 2024

Conversation

DABND19
Copy link
Contributor

@DABND19 DABND19 commented May 13, 2024

For this example graceful shutdown for uvicorn service doesn't work:

import asyncio

import aiomisc
import fastapi
from aiomisc.service.uvicorn import UvicornService

app = fastapi.FastAPI()

@app.get('/hello')
async def hello_world():
    await asyncio.sleep(15)
    return {'message': 'Hello, world!!!'}


class API(UvicornService):
    async def create_application(self) -> fastapi.FastAPI:
        return app


if __name__ == '__main__':
    with aiomisc.entrypoint(API()) as loop:
        loop.run_forever()

@DABND19 DABND19 force-pushed the fix/uvicorn-service branch from 2ec521a to 9f78a73 Compare May 13, 2024 14:22
@DABND19 DABND19 marked this pull request as draft May 13, 2024 14:49
@DABND19 DABND19 force-pushed the fix/uvicorn-service branch from 9f78a73 to a431c33 Compare May 13, 2024 16:09
@DABND19 DABND19 marked this pull request as ready for review May 13, 2024 21:18
@mosquito mosquito merged commit 3d38ade into aiokitchen:master May 14, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants