added support for gateway ttl and manual pruning

This commit is contained in:
Alok Saldanha
2019-09-16 17:12:29 -04:00
parent 90d5d8b570
commit a6c9456786
5 changed files with 42 additions and 14 deletions
+13 -1
View File
@@ -187,9 +187,21 @@ 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):
dataset = get_dataset(path)
match = cache.check_entry(dataset)
if match is None:
return "not found"
else:
pruner.prune(match)
return "success"
def main():
env.validate()
background_thread = Thread(target=PruneProcessCache(cache))
background_thread = Thread(target=pruner)
background_thread.start()
app.run(host="0.0.0.0", port=5005, debug=False)