浏览代码

Fudge default API query wait times a bit

- Plus a bugfix in RC.parse()
tags/v0.1^2
Ben Kurtovic 12 年前
父节点
当前提交
5f41a1aa7a
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. +1
    -1
      earwigbot/irc/rc.py
  2. +3
    -3
      earwigbot/wiki/site.py
  3. +1
    -1
      earwigbot/wiki/sitesdb.py

+ 1
- 1
earwigbot/irc/rc.py 查看文件

@@ -52,7 +52,7 @@ class RC(object):
# We're probably missing the http:// part, because it's a log
# entry, which lacks a URL:
page, flags, user, comment = self.re_log.findall(msg)[0]
url = "http://{0}.org/wiki/{1}".format(self.chan, page)
url = "http://{0}.org/wiki/{1}".format(self.chan[1:], page)

self.is_edit = False # This is a log entry, not edit



+ 3
- 3
earwigbot/wiki/site.py 查看文件

@@ -86,7 +86,7 @@ class Site(object):
article_path=None, script_path=None, sql=None,
namespaces=None, login=(None, None), cookiejar=None,
user_agent=None, use_https=False, assert_edit=None,
maxlag=None, wait_between_queries=5, logger=None,
maxlag=None, wait_between_queries=3, logger=None,
search_config=(None, None)):
"""Constructor for new Site instances.

@@ -120,7 +120,7 @@ class Site(object):
self._assert_edit = assert_edit
self._maxlag = maxlag
self._wait_between_queries = wait_between_queries
self._max_retries = 5
self._max_retries = 6
self._last_query_time = 0
self._api_lock = Lock()

@@ -276,7 +276,7 @@ class Site(object):
msg = 'Server says "{0}"; retrying in {1} seconds ({2}/{3})'
self._logger.info(msg.format(info, wait, tries, self._max_retries))
sleep(wait)
return self._api_query(params, tries=tries, wait=wait*3)
return self._api_query(params, tries=tries, wait=wait*2)
else: # Some unknown error occurred
e = 'API query failed: got error "{0}"; server says: "{1}".'
error = exceptions.SiteAPIError(e.format(code, info))


+ 1
- 1
earwigbot/wiki/sitesdb.py 查看文件

@@ -175,7 +175,7 @@ class SitesDB(object):
use_https = config.wiki.get("useHTTPS", False)
assert_edit = config.wiki.get("assert")
maxlag = config.wiki.get("maxlag")
wait_between_queries = config.wiki.get("waitTime", 5)
wait_between_queries = config.wiki.get("waitTime", 3)
logger = self._logger.getChild(name)
search_config = config.wiki.get("search")



正在加载...
取消
保存