Skip to content

Commit

Permalink
Include fractions of seconds in api delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunck committed Nov 20, 2010
1 parent c595cf6 commit 4d90571
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion github2/request.py
Expand Up @@ -72,7 +72,7 @@ def post(self, *path_components, **extra_post_data):
def make_request(self, path, extra_post_data=None, method="GET"):
if self.delay:
since_last = (datetime.datetime.now() - self.last_request)
since_last_in_seconds = since_last.days * 24 * 60 * 60 + since_last.seconds
since_last_in_seconds = (since_last.days * 24 * 60 * 60) + since_last.seconds + (since_last.microseconds/1000000.0)
if since_last_in_seconds < self.delay:
duration = self.delay - since_last_in_seconds
if self.debug:
Expand Down

0 comments on commit 4d90571

Please sign in to comment.