-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dtrenkenshu
authored and
dtrenkenshu
committed
Aug 15, 2017
1 parent
f6097b2
commit a4c3409
Showing
12 changed files
with
342 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
openprocurement/bot/identification/databridge/sleep_change_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
class APIRateController: | ||
# coding=utf-8 | ||
class APIRateController(object): | ||
def __init__(self, increment_step=1, decrement_step=1): | ||
self.increment_step = increment_step | ||
self.decrement_step = decrement_step | ||
self.time_between_requests = 0 | ||
|
||
def decrement(self): | ||
self.time_between_requests -= self.decrement_step if self.decrement_step < self.time_between_requests else 0 | ||
self.time_between_requests -= self.decrement_step if self.decrement_step <= self.time_between_requests else 0 | ||
return self.time_between_requests | ||
|
||
def increment(self): | ||
self.time_between_requests += self.increment_step | ||
return self.time_between_requests | ||
return self.time_between_requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.