#2 added a way to relaunch a cellxgene server

This commit is contained in:
Alok Saldanha
2019-09-17 10:13:20 -04:00
parent a6c9456786
commit 2b259ab6b5
4 changed files with 22 additions and 19 deletions
+7 -8
View File
@@ -18,6 +18,7 @@ from flask import (
render_template,
request,
send_from_directory,
url_for,
)
from flask_api import status
from werkzeug import secure_filename
@@ -187,20 +188,18 @@ def do_GET_status():
"cache_status.html", entry_list=cache.entry_list
)
pruner = PruneProcessCache(cache)
@app.route("/prune/<path:path>", methods=["DELETE"])
def do_prune(path):
@app.route("/relaunch/<path:path>", methods=["GET"])
def do_relaunch(path):
dataset = get_dataset(path)
match = cache.check_entry(dataset)
if match is None:
return "not found"
else:
pruner.prune(match)
return "success"
if not match is None:
match.terminate()
return redirect(url_for('view', path=path), code=301)
def main():
env.validate()
pruner = PruneProcessCache(cache)
background_thread = Thread(target=pruner)
background_thread.start()