Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/cli.py
Show First 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | |||||
@click.option( | @click.option( | ||||
"--graph", "-g", required=True, metavar="GRAPH", help="compressed graph basename" | "--graph", "-g", required=True, metavar="GRAPH", help="compressed graph basename" | ||||
) | ) | ||||
@click.pass_context | @click.pass_context | ||||
def serve(ctx, host, port, graph): | def serve(ctx, host, port, graph): | ||||
"""run the graph RPC service""" | """run the graph RPC service""" | ||||
import aiohttp | import aiohttp | ||||
from swh.graph.backend import Backend | |||||
from swh.graph.server.app import make_app | from swh.graph.server.app import make_app | ||||
backend = Backend(graph_path=graph, config=ctx.obj["config"]) | app = make_app(config=ctx.obj["config"]) | ||||
app = make_app(backend=backend) | |||||
with backend: | |||||
aiohttp.web.run_app(app, host=host, port=port) | aiohttp.web.run_app(app, host=host, port=port) | ||||
@graph_cli_group.command() | @graph_cli_group.command() | ||||
@click.option( | @click.option( | ||||
"--graph", | "--graph", | ||||
"-g", | "-g", | ||||
required=True, | required=True, | ||||
metavar="GRAPH", | metavar="GRAPH", | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |