Initial local translation API with persistent projects and batch jobs
This commit is contained in:
commit
13492929c6
21 files changed
+1624
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
import uvicorn
|
||||
|
||||
from .api import create_app
|
||||
from .config import load_settings
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Local game translation API")
|
||||
parser.add_argument("--config", default="config.toml")
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
settings = load_settings(args.config)
|
||||
except (ValueError, OSError) as exc:
|
||||
print(f"Cannot load configuration: {exc}", file=sys.stderr)
|
||||
raise SystemExit(1) from exc
|
||||
# One worker owns the persisted queue. Only loopback is exposed.
|
||||
uvicorn.run(create_app(settings), host="127.0.0.1", port=settings.port, workers=1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user