Browse Source

Make sure the CV workers don't spit out tons of logs.

pull/24/head
Ben Kurtovic 10 years ago
parent
commit
55e5a108c6
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      app.fcgi

+ 3
- 2
app.fcgi View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-


from functools import wraps from functools import wraps
from logging import DEBUG
from logging import DEBUG, INFO, getLogger
from logging.handlers import TimedRotatingFileHandler from logging.handlers import TimedRotatingFileHandler
from time import asctime from time import asctime
from traceback import format_exc from traceback import format_exc
@@ -27,6 +27,8 @@ app.logger.addHandler(TimedRotatingFileHandler(
app.logger.info(u"Flask server started " + asctime()) app.logger.info(u"Flask server started " + asctime())


bot = Bot(".earwigbot", 100) bot = Bot(".earwigbot", 100)
getLogger("earwigbot.wiki.cvworker").setLevel(INFO)
globalize()


def catch_errors(func): def catch_errors(func):
@wraps(func) @wraps(func)
@@ -41,7 +43,6 @@ def catch_errors(func):


@app.before_request @app.before_request
def prepare_request(): def prepare_request():
globalize()
g.bot = bot g.bot = bot
g.globals_db = g.cache_db = None g.globals_db = g.cache_db = None
g.cookies = parse_cookies(request.script_root, g.cookies = parse_cookies(request.script_root,


Loading…
Cancel
Save