Sfoglia il codice sorgente

Cleanup; call update_sites() before API requests.

pull/24/head
Ben Kurtovic 9 anni fa
parent
commit
aef27a53a1
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +1
    -1
      app.fcgi
  2. +1
    -1
      templates/api.mako

+ 1
- 1
app.fcgi Vedi File

@@ -49,7 +49,6 @@ def setup_app():
cache.last_background_updates = {} cache.last_background_updates = {}


getLogger("earwigbot.wiki.cvworker").setLevel(INFO) getLogger("earwigbot.wiki.cvworker").setLevel(INFO)
# getLogger().handlers ....
globalize() globalize()


@app.before_request @app.before_request
@@ -107,6 +106,7 @@ def api_json():


format = request.args.get("format", "json") format = request.args.get("format", "json")
if format in ["json", "jsonfm"]: if format in ["json", "jsonfm"]:
update_sites()
try: try:
result = handle_api_request() result = handle_api_request()
except Exception as exc: except Exception as exc:


+ 1
- 1
templates/api.mako Vedi File

@@ -14,7 +14,7 @@
% endfor % endfor
${do_indent(indent)} ${do_indent(indent)}
} }
% elif isinstance(obj, (type([]), type(()))):
% elif isinstance(obj, (list, tuple, set)):
[ [
% for elem in obj: % for elem in obj:
${do_indent(indent + 1)} ${do_indent(indent + 1)}


Caricamento…
Annulla
Salva