pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use_reloader not working as intended

Randark-JMT opened this issue · comments

following is my code

# main.py
import asyncio
from hypercorn.config import Config
from hypercorn.asyncio import serve

from api.main import app

config = Config()
customConfig = {
    "bind": ["0.0.0.0:8080"],
    "use_reloader": True,
    "accesslog": "-",
    "errorlog": "-",
}

asyncio.run(serve(app, Config.from_mapping(customConfig)))

and api file

# api/main.py
from typing import Union
from fastapi import FastAPI
from api.manager.dockers import docker_manager

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}

Expected Behavior

Application should reload when changes are made to the source code

Actual Behavior

API does not reload and changes do not appear on the running application

Steps to Reproduce the Problem

  1. Run the code
    python main.py
  2. Modify the code as the application is running

Version:

  • Python 3.11.6
  • Hypercorn 0.16.0
  • Ubuntu 23.10

Can confirm that changes made during development are not being reloaded.

Using

  • Hypercorn 0.16.0
  • FastAPI 0.110.0
  • Uvloop 0.19.0

Any update on this it's same for me as well. No reload happens use_reloaded=True

Nope and gave up on hypercorn. I'm using unicorn right now.