Merge branch '2.0.0' into 2.0.0-refactoring
This commit is contained in:
commit
e73cfe5d87
@ -7,7 +7,7 @@ service:
|
|||||||
response_folder: $RESPONSE_FOLDER|null
|
response_folder: $RESPONSE_FOLDER|null
|
||||||
# Specifies, how to handle the `page` key of a request. "multi" will download all pages matching the list of pages
|
# Specifies, how to handle the `page` key of a request. "multi" will download all pages matching the list of pages
|
||||||
# specified in the request
|
# specified in the request
|
||||||
download_strategy: single
|
download_strategy: $DOWNLOAD_STRATEGY|single
|
||||||
|
|
||||||
probing_webserver:
|
probing_webserver:
|
||||||
host: $PROBING_WEBSERVER_HOST|"0.0.0.0" # Probe webserver address
|
host: $PROBING_WEBSERVER_HOST|"0.0.0.0" # Probe webserver address
|
||||||
|
|||||||
@ -52,14 +52,15 @@ def __set_up_processing_server_impl(operation2function: Dict[str, QueuedStreamFu
|
|||||||
op: LazyRestProcessor(fn, **build_endpoint_suffixes(op)) for op, fn in operation2function.items()
|
op: LazyRestProcessor(fn, **build_endpoint_suffixes(op)) for op, fn in operation2function.items()
|
||||||
}
|
}
|
||||||
|
|
||||||
def make_summary_instance(op):
|
def make_summary_instance(op: str):
|
||||||
|
op = op.replace("_pickup", "")
|
||||||
return Summary(f"redactmanager_{op}_seconds", f"Time spent on {op}.", registry=registry)
|
return Summary(f"redactmanager_{op}_seconds", f"Time spent on {op}.", registry=registry)
|
||||||
|
|
||||||
submit_operation2processor = {submit_suffix(op): prc for op, prc in operation2processor.items()}
|
submit_operation2processor = {submit_suffix(op): prc for op, prc in operation2processor.items()}
|
||||||
pickup_operation2processor = {pickup_suffix(op): prc for op, prc in operation2processor.items()}
|
pickup_operation2processor = {pickup_suffix(op): prc for op, prc in operation2processor.items()}
|
||||||
operation2processor = merge(submit_operation2processor, pickup_operation2processor)
|
operation2processor = merge(submit_operation2processor, pickup_operation2processor)
|
||||||
|
|
||||||
operation2metric = {op: make_summary_instance(op) for op in operation2processor}
|
operation2metric = {op: make_summary_instance(op) for op in pickup_operation2processor}
|
||||||
|
|
||||||
@app.route("/ready", methods=["GET"])
|
@app.route("/ready", methods=["GET"])
|
||||||
def ready():
|
def ready():
|
||||||
@ -83,7 +84,7 @@ def __set_up_processing_server_impl(operation2function: Dict[str, QueuedStreamFu
|
|||||||
|
|
||||||
@app.route("/<operation>", methods=["GET"])
|
@app.route("/<operation>", methods=["GET"])
|
||||||
def pickup(operation):
|
def pickup(operation):
|
||||||
with operation2metric[operation.replace("_pickup", "")].time():
|
with operation2metric[operation].time():
|
||||||
return operation2processor[operation].pop()
|
return operation2processor[operation].pop()
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user