migration: preserve startup accounts and system slice

This commit is contained in:
leefer
2026-07-31 00:42:06 +08:00
parent e4a9b2e647
commit 982af4ba92
32 changed files with 6675 additions and 6321 deletions
+27
View File
@@ -0,0 +1,27 @@
from __future__ import annotations
import argparse
from http.server import ThreadingHTTPServer
from typing import Any
def main(handler_class: type[Any] | None = None, service: Any | None = None) -> None:
if handler_class is None or service is None:
from backend.application import RequestHandler, SERVICE
handler_class = handler_class or RequestHandler
service = service or SERVICE
parser = argparse.ArgumentParser(description="Xiaobai stock review web application")
parser.add_argument("--host", default="127.0.0.1")
parser.add_argument("--port", type=int, default=8765)
args = parser.parse_args()
server = ThreadingHTTPServer((args.host, args.port), handler_class)
print(f"Xiaobai Review Web is running at http://{args.host}:{args.port}")
print("Press Ctrl+C to stop.")
try:
server.serve_forever()
except KeyboardInterrupt:
pass
finally:
service._background_stop.set()
server.server_close()