Write request reson to log if not 200 "OK"
This commit is contained in:
parent
65a48a403c
commit
7471face3f
1 changed files with 2 additions and 0 deletions
|
@ -124,6 +124,8 @@ def get_new_data():
|
|||
key = 'key {}'.format(app_key)
|
||||
headers = {'Authorization': key, 'Content-Type': 'application/json'}
|
||||
response = requests.get(endpoint, headers=headers)
|
||||
if response.status_code != 200:
|
||||
logger.info(response.reason)
|
||||
try:
|
||||
for each_resp in response.json():
|
||||
if (not Location.query.filter(Location.datetime == each_resp['time']).first() and
|
||||
|
|
Loading…
Add table
Reference in a new issue