def do_relaunch(path): key = get_key(path) match = cache.check_entry(key) if not match is None: match.terminate() qs = request.query_string.decode() return redirect(url_for("do_view", path=path) + (f'?{qs}' if len(qs) > 0 else ''), code=302)
def do_view(path): key = get_key(path) print( f"view path={path}, dataset={key.dataset}, annotation_file= {key.annotation_file}, key={key.pathpart}" ) with entry_lock: match = cache.check_entry(key) if match is None: uascripts = get_extra_scripts() match = cache.create_entry(key, uascripts) match.timestamp = current_time_stamp() if match.status == "loaded" or match.status == "loading": return match.serve_content(path) elif match.status == "error": raise ProcessException.from_cache_entry(match)
def do_terminate(path): key = get_key(path) match = cache.check_entry(key) if not match is None: match.terminate() return redirect(url_for("do_GET_status"), code=302)