mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-10 06:54:54 +08:00
Make sure we always run uvicorn on Windows
This commit is contained in:
parent
258f9fe44e
commit
d0e8d73e22
1 changed files with 6 additions and 3 deletions
|
@ -60,7 +60,11 @@ if __name__ == "__main__":
|
|||
except (TypeError, KeyError):
|
||||
port = None
|
||||
|
||||
if _DEV:
|
||||
|
||||
logger = logger_get_logger()
|
||||
# Cannot run gunicorn on Windows
|
||||
if _DEV or os.name == 'nt':
|
||||
logger.info("Running dev version")
|
||||
import uvicorn
|
||||
|
||||
server_args = {
|
||||
|
@ -101,9 +105,8 @@ if __name__ == "__main__":
|
|||
"worker_class": "uvicorn.workers.UvicornWorker",
|
||||
}
|
||||
|
||||
logger = logger_get_logger()
|
||||
try:
|
||||
if _DEV:
|
||||
if _DEV or os.name == 'nt':
|
||||
uvicorn.run("upgrade_server.api:app", **server_args)
|
||||
else:
|
||||
StandaloneApplication(upgrade_server.api.app, server_args).run()
|
||||
|
|
Loading…
Add table
Reference in a new issue