From 27fde5a910c5274e6f56bbb0b46dbb375822296d Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Fri, 6 Oct 2017 15:04:18 +0200 Subject: [PATCH] Use "{id}:{secret}" as caching key --- .../cartodb_services/google/client_factory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/google/client_factory.py b/server/lib/python/cartodb_services/cartodb_services/google/client_factory.py index c60c1c3..caf3fd8 100644 --- a/server/lib/python/cartodb_services/cartodb_services/google/client_factory.py +++ b/server/lib/python/cartodb_services/cartodb_services/google/client_factory.py @@ -10,13 +10,14 @@ class GoogleMapsClientFactory(): @classmethod def get(cls, client_id, client_secret): - client = cls.clients.get(client_id) + cache_key = "{}:{}".format(client_id, client_secret) + client = cls.clients.get(cache_key) if not client: cls.assert_valid_crendentials(client_secret) client = googlemaps.Client( client_id=client_id, client_secret=client_secret) - cls.clients[client_id] = client + cls.clients[cache_key] = client return client @classmethod