Browse Source

Fix arg counts, fix _get_service_order() when retrieving lag from cache.

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
d70fa3927c
2 changed files with 5 additions and 2 deletions
  1. +2
    -2
      earwigbot/wiki/category.py
  2. +3
    -0
      earwigbot/wiki/site.py

+ 2
- 2
earwigbot/wiki/category.py View File

@@ -126,7 +126,7 @@ class Category(Page):
self.site.SERVICE_API: self._get_size_via_api,
self.site.SERVICE_SQL: self._get_size_via_sql
}
return self.site.delegate(services, (self, member_type,))
return self.site.delegate(services, (member_type))

@property
def size(self):
@@ -202,4 +202,4 @@ class Category(Page):
}
if follow_redirects is None:
follow_redirects = self._follow_redirects
return self.site.delegate(services, (self, follow_redirects,))
return self.site.delegate(services, (limit, follow_redirects))

+ 3
- 0
earwigbot/wiki/site.py View File

@@ -555,6 +555,7 @@ class Site(object):
else:
if not self._sql_info_cache["usable"]:
return [self.SERVICE_API]
sqllag = self._sql_info_cache["replag"]

if sqllag > 180:
if not self._maxlag:
@@ -565,6 +566,8 @@ class Site(object):
self._api_info_cache["maxlag"] = apilag = self.get_maxlag()
except exceptions.APIError:
self._api_info_cache["maxlag"] = apilag = 0
else:
apilag = self._api_info_cache["maxlag"]
if sqllag / (180.0 / self._maxlag) < apilag:
return [self.SERVICE_SQL, self.SERVICE_API]
return [self.SERVICE_API, self.SERVICE_SQL]


Loading…
Cancel
Save