Browse Source

Correct handling when we run out of _get_revision_content() retries.

pull/15/head
Ben Kurtovic 11 years ago
parent
commit
805b59fb08
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      tasks/afc_statistics.py

+ 4
- 3
tasks/afc_statistics.py View File

@@ -519,9 +519,10 @@ class AFCStatistics(Task):
try: try:
content = res["query"]["pages"].values()[0]["revisions"][0]["*"] content = res["query"]["pages"].values()[0]["revisions"][0]["*"]
except KeyError: except KeyError:
if tries > 0:
sleep(5)
return self._get_revision_content(revid, tries=tries - 1)
if tries == 0:
raise KeyError()
sleep(5)
return self._get_revision_content(revid, tries=tries - 1)
self.revision_cache[revid] = content self.revision_cache[revid] = content
return content return content




Loading…
Cancel
Save