Selaa lähdekoodia

Added message to the memoize/redis cache.

root 4 vuotta sitten
vanhempi
commit
96346373bc
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      messages.py

+ 6 - 1
messages.py

@@ -35,6 +35,10 @@ def get_messages(base):
     messages.reverse()
     messages.reverse()
     return messages
     return messages
 
 
[email protected](timeout=60)
+def get_message(base, msgno):
+    message = jammin.read_message(base, msgno)
+    return message
 
 
 @app.route(base_path + "/list")
 @app.route(base_path + "/list")
 def list_bases():
 def list_bases():
@@ -104,7 +108,8 @@ def display_message(area, msgno):
             "missing-area.html", base_path=base_path, title="Missing Area"
             "missing-area.html", base_path=base_path, title="Missing Area"
         )
         )
 
 
-    message = jammin.read_message(bases[area], msgno)
+    # message = jammin.read_message(bases[area], msgno)
+    message = get_message(bases[area], msgno)
 
 
     if not message:
     if not message:
         return render_template(
         return render_template(