Sfoglia il codice sorgente

Increase log message verbosity; fix import.

pull/24/head
Ben Kurtovic 10 anni fa
parent
commit
9e13ac1c04
2 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. +3
    -2
      app.fcgi
  2. +2
    -1
      copyvios/checker.py

+ 3
- 2
app.fcgi Vedi File

@@ -54,8 +54,9 @@ def add_new_cookies(response):

@app.after_request
def write_access_log(response):
msg = u"%s %s -> %s"
app.logger.debug(msg, asctime(), request.path, response.status_code)
msg = u"%s %s %s %s -> %s"
app.logger.debug(msg, asctime(), request.method, request.path,
request.values.to_dict(), response.status_code)
return response

@app.teardown_appcontext


+ 2
- 1
copyvios/checker.py Vedi File

@@ -5,6 +5,7 @@ from hashlib import sha256
from urlparse import urlparse

from earwigbot import exceptions
from earwigbot.wiki.copyvios.markov import EMPTY

from .misc import Query, get_cache_db
from .sites import get_site, get_sites
@@ -113,7 +114,7 @@ def _get_cached_results(page, conn, query):

def _do_copyvio_compare(query, page, url):
result = page.copyvio_compare(url, min_confidence=T_SUSPECT, max_time=30)
if result.source_chain is not page.EMPTY:
if result.source_chain is not EMPTY:
return result
query.error = "timeout" if result.time > 30 else "no data"



Caricamento…
Annulla
Salva