MCPcopy Index your code
hub / github.com/su-kaka/gcli2api / _run

Function _run

web.py:176–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 workers = int(os.environ.get("WORKERS", 1))
175
176 async def _run():
177 port = await get_server_port()
178 host = await get_server_host()
179
180 log.info("=" * 60)
181 log.info("启动 GCLI2API")
182 log.info("=" * 60)
183 log.info(f"控制面板: http://127.0.0.1:{port}")
184 if workers > 1:
185 log.info(f"Worker 数量: {workers}")
186 log.info("=" * 60)
187
188 config = Config()
189 config.bind = [f"{host}:{port}"]
190 config.accesslog = "-"
191 config.errorlog = "-"
192 config.loglevel = "INFO"
193
194 await serve(app, config)
195
196 if workers == 1:
197 asyncio.run(_run())

Callers 1

mainFunction · 0.85

Calls 4

get_server_portFunction · 0.90
get_server_hostFunction · 0.90
infoMethod · 0.80
ConfigClass · 0.50

Tested by

no test coverage detected