diff --git a/web/run.py b/web/run.py index 2c658cf..efa5313 100755 --- a/web/run.py +++ b/web/run.py @@ -804,15 +804,17 @@ def download_targets_netcdf(targets, params, started_at, stopped_at): # API ######################################################################### -@app.route("/cache/clear") -def cache_clear(): +@app.route("/cache/cleanup") +def cache_cleanup(): """ Removes all files from the cache that are older than roughly one month. """ a_month_ago = datetime.datetime.now() - datetime.timedelta(days=32) cache_dir = get_path('../cache') removed_files = remove_files_created_before(a_month_ago, cache_dir) - return "Cache cleared! Removed %d old file(s)." % len(removed_files) + count = len(removed_files) + return "Cache cleaned! Removed %d old file%s." \ + % (count, 's' if count != 1 else '') @app.route("/cache/warmup") -- libgit2 0.21.2