Skip to content

Commit

Permalink
Merge branch 'main' of github.com:LiquidAI-project/wasmiot-supervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
isoteemu committed Jun 14, 2024
2 parents 3ce98e0 + 82dd6fb commit 53058cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions host_app/flask_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ def thingi_health():
"cpuUsage": random.random()
})

@bp.route('/module_results/<module_name>/<filename>')
def get_module_result(module_name: str, filename: str):
"""
Return the result file of a module execution.
"""
return send_file(Path(INSTANCE_PARAMS_FOLDER, module_name, filename))

def results_route(request_id=None, full=False):
'''
Return the route where execution/request results can be read from.
Expand Down Expand Up @@ -409,6 +416,9 @@ def run_module_function(deployment_id, module_name, function_name, filename=None
else:
# Send data to worker thread to handle non-blockingly.
wasm_queue.put(entry)

# Log the result of the execution.
get_logger(request).debug("Execution result: %r", entry.result, extra={"request": entry})

# Return a link to this request's result (which could link further until
# some useful value is found).
Expand Down

0 comments on commit 53058cc

Please sign in to comment.