Sfoglia il codice sorgente

Use a fuzzier timestamp check.

pull/15/head
Ben Kurtovic 11 anni fa
parent
commit
d7028711d8
1 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. +5
    -4
      tasks/afc_statistics.py

+ 5
- 4
tasks/afc_statistics.py Vedi File

@@ -648,13 +648,14 @@ class AFCStatistics(Task):
submits.append(data)
if not submits:
return None
latest = max(submits, key=lambda pair: pair[1])
user, stamp = max(submits, key=lambda pair: pair[1])

query = """SELECT rev_id FROM revision WHERE rev_page = ?
AND rev_user_text = ? AND rev_timestamp = ?"""
result = self.site.sql_query(query, (pageid, latest[0], latest[1]))
AND rev_user_text = ? AND ABS(rev_timestamp - ?) <= 60
ORDER BY ABS(rev_timestamp - ?) ASC LIMIT 1"""
result = self.site.sql_query(query, (pageid, user, stamp, stamp))
try:
return latest[0], latest[1], list(result)[0]
return user, stamp, list(result)[0]
except IndexError:
return None



Caricamento…
Annulla
Salva