Skip to content

Commit

Permalink
Merge pull request #162 from mattbillenstein/master
Browse files Browse the repository at this point in the history
Retry logging tweaks
  • Loading branch information
jgorset committed Mar 11, 2018
2 parents 228228e + 60a39a6 commit 0ad1867
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions facepy/graph_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

from facepy.exceptions import *

log = logging.getLogger(__name__)


class GraphAPI(object):
def __init__(self, oauth_token=False, url='https://graph.facebook.com', verify_ssl_certificate=True, appsecret=False, timeout=None, version=None):
Expand Down Expand Up @@ -287,11 +289,11 @@ def load_with_retry(method, url, data):
try:
return load(method, url, data)
except FacepyError as e:
logging.warn("Exception on %s: %s, retries remaining: %s" % (
log.warn("Exception on %s: %s, retries remaining: %s",
url,
e,
remaining_retries,
))
)
if remaining_retries > 0:
remaining_retries -= 1
else:
Expand Down

0 comments on commit 0ad1867

Please sign in to comment.