Skip to content

Commit

Permalink
Revert "Revert "Merge pull request #568 from NobodyNada/patch-1 --aut…
Browse files Browse the repository at this point in the history
…opull""

I honestly don't believe this is a material cause of the issue we're
seeing.
  • Loading branch information
Undo1 committed Mar 7, 2017
1 parent f8baad1 commit aa2a953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apigetpost.py
Expand Up @@ -30,6 +30,7 @@ def api_get_post(post_url):
time.sleep(GlobalVars.api_backoff_time - time.time() + 2)
d = parsing.fetch_post_id_and_site_from_url(post_url)
if d is None:
GlobalVars.api_request_lock.release()
return None
post_id, site, post_type = d
if post_type == "answer":
Expand All @@ -46,6 +47,7 @@ def api_get_post(post_url):
if GlobalVars.api_backoff_time < time.time() + response["backoff"]:
GlobalVars.api_backoff_time = time.time() + response["backoff"]
if 'items' not in response or len(response['items']) == 0:
GlobalVars.api_request_lock.release()
return False
GlobalVars.api_request_lock.release()

Expand Down
1 change: 1 addition & 0 deletions bodyfetcher.py
Expand Up @@ -199,6 +199,7 @@ def make_api_call_for_site(self, site):
else:
self.queue[site] = posts
self.queue_modify_lock.release()
GlobalVars.api_request_lock.release()
return

self.api_data_lock.acquire()
Expand Down

0 comments on commit aa2a953

Please sign in to comment.