diff options
author | zsloan | 2023-01-20 22:02:58 +0000 |
---|---|---|
committer | zsloan | 2023-02-28 14:18:09 -0600 |
commit | c7ba9ebee7708be9c6761bf77bd6c1ce48e45319 (patch) | |
tree | 95a312ae4269c07dfa16f5185b59d1b06a5b2756 | |
parent | a215f40105ef89be44dff0b1eac3218c71ded5ed (diff) | |
download | genenetwork2-c7ba9ebee7708be9c6761bf77bd6c1ce48e45319.tar.gz |
Add endpoint for caching mapping inputs
-rw-r--r-- | wqflask/wqflask/views.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 0a8f3105..c48965fc 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -741,7 +741,8 @@ def mapping_results_page(): 'mapmodel_rqtl', 'temp_trait', 'n_samples', - 'transform' + 'transform', + 'hash_of_inputs' ) start_vars = {} for key, value in list(initial_start_vars.items()): @@ -780,6 +781,14 @@ def mapping_results_page(): return rendered_template +@app.route("/cache_mapping_inputs", methods=('POST',)) +def cache_mapping_inputs(): + TWO_MONTHS = 60 * 60 * 24 * 60 + cache_id = request.form.get("inputs_hash") + inputs_json = Redis.get(cache_id) + Redis.set(cache_id, inputs_json, ex=TWO_MONTHS) + + return "Success" @app.route("/export_mapping_results", methods=('POST',)) def export_mapping_results(): |