Closed sreenivasulureddysura closed 4 months ago
@gi0baro Can you help me on this issue?
Found one more issue while running in this format?
if __name__ == "__main__":
granian.Granian(target='main:app', address='127.0.0.1', port=8000, workers=1).serve()
C:\bot>python app\main.py
[INFO] Starting granian (main PID: 23800)
[INFO] Listening at: http://127.0.0.1:8000
[INFO] Spawning worker-1 with pid: 34268
[INFO] Started worker-1
[INFO] Started worker-1 runtime-1
[ERROR] Application callable raised an exception
Traceback (most recent call last):
File "C:\Lib\site-packages\granian\_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: FastAPI.__call__() missing 1 required positional argument: 'send'
[ERROR] Application callable raised an exception
Traceback (most recent call last):
File "C:\Lib\site-packages\granian\_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: FastAPI.__call__() missing 1 required positional argument: 'send'
[ERROR] Application callable raised an exception
Traceback (most recent call last):
File "C:\Lib\site-packages\granian\_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: FastAPI.__call__() missing 1 required positional argument: 'send'
[ERROR] Application callable raised an exception
Traceback (most recent call last):
File "C:\Lib\site-packages\granian\_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: FastAPI.__call__() missing 1 required positional argument: 'send'
@sreenivasulureddysura target
is the application to load, so given your Uvicorn example, this should work:
if __name__ == "__main__":
granian.Granian("main:app", interface='asgi', address='0.0.0.0' port=8080, log_level="info", reload=True).serve()
I can use it in uvicorn below approach
How to use the granian.Granian with different options?