Skip to content

Commit

Permalink
get rid of the throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
James Michael DuPont authored and James Michael DuPont committed Aug 8, 2012
1 parent 0355868 commit 5c410d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pywikibot/throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, mindelay=None, maxdelay=None, writedelay=None,
multiplydelay=True, verbosedelay=False, write=False):
self.lock = threading.RLock()
self.mysite = None
self.ctrlfilename = config.datafilepath('pywikibot', 'throttle.ctrl')
self.ctrlfilename = config.datafilepath('pywikibot2', 'throttle2.ctrl')
self.mindelay = mindelay
if self.mindelay is None:
self.mindelay = config.minthrottle
Expand Down Expand Up @@ -234,7 +234,8 @@ def __call__(self, requestsize=1, write=False):
"""
self.lock.acquire()
try:
wait = self.waittime(write=write or self.write)
#wait = self.waittime(write=write or self.write)
wait = 1
# Calculate the multiplicity of the next delay based on how
# big the request is that is being posted now.
# We want to add "one delay" for each factor of two in the
Expand Down Expand Up @@ -271,7 +272,8 @@ def lag(self, lagtime):
# wait at least 5 seconds but not more than 120 seconds
delay = min(max(5, lagtime//2), 120)
# account for any time we waited while acquiring the lock
wait = delay - (time.time() - started)
# wait = delay - (time.time() - started)
wait = 1
if wait > 0:
if wait > config.noisysleep:
pywikibot.output(
Expand Down

0 comments on commit 5c410d4

Please sign in to comment.