Merge pull request #243 from CartoDB/development
Added QPS for mapzen isolines
This commit is contained in:
commit
073be9dae4
@ -1,5 +1,6 @@
|
||||
import requests
|
||||
import json
|
||||
from qps import qps_retry
|
||||
|
||||
class MatrixClient:
|
||||
|
||||
@ -30,6 +31,7 @@ class MatrixClient:
|
||||
Returns:
|
||||
A dict with one_to_many, units and locations
|
||||
"""
|
||||
@qps_retry
|
||||
def one_to_many(self, locations, costing):
|
||||
request_params = {
|
||||
'json': json.dumps({'locations': locations}),
|
||||
|
@ -26,7 +26,7 @@ class QPSService:
|
||||
try:
|
||||
return fn(*args, **kwargs)
|
||||
except Exception as e:
|
||||
if hasattr(e, 'response') and e.response.status_code == 429:
|
||||
if hasattr(e, 'response') and (e.response.status_code == 429 or e.response.status_code == 504):
|
||||
self.retry(start_time, attempt_number)
|
||||
else:
|
||||
raise e
|
||||
|
@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
||||
setup(
|
||||
name='cartodb_services',
|
||||
|
||||
version='0.7.2.2',
|
||||
version='0.7.2.3',
|
||||
|
||||
description='CartoDB Services API Python Library',
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user