瀏覽代碼

Added /clear to clear the cache.

Steve Thielemann 4 年之前
父節點
當前提交
941da740ad
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      messages.py

+ 11 - 5
messages.py

@@ -26,11 +26,11 @@ cache = Cache(app, config={"CACHE_TYPE": "redis", "CACHE_REDIS_HOST": "redis"})
 import jammin
 
 bases = {
-    "FSX_General": "msgs/fsx_gen",
-    "FSX_BBS": "msgs/fsx_bbs",
-    "FSX_BOT": "msgs/fsx_bot",
-    "FSX_Magicka": "msgs/fsx_mag",
-    "HappyNet": "msgs/hpy_gen",
+    "FSXNET-General": "msgs/fsx_gen",
+    "FSXNET-BBS": "msgs/fsx_bbs",
+    "FSXNET-BOT": "msgs/fsx_bot",
+    "FSXNET-Magicka": "msgs/fsx_mag",
+    "HappyNet-General": "msgs/hpy_gen",
 }
 
 # bases = {"FSX_BOT": "fsx_bot"}
@@ -64,6 +64,12 @@ def list_bases():
     # return 'Here would be a listing of message bases'
 
 
[email protected](base_path + "/clear")
+def clear_cache():
+    cache.clear()
+    return "Cache Cleared.  Back to hitting refresh!"
+
+
 @app.route(base_path + "/messages/<area>")
 def display_messages(area):
     if area not in bases: