Add params to InternalGeocoderConfig #302

Add a bunch of params to InternalGeocoderConfig for consistency with
other services:
- monthly_quota
- period_end_date
- soft_limit
This commit is contained in:
Rafa de la Torre
2016-11-23 17:04:48 +01:00
parent a1eae3934c
commit 579d11ebd5

View File

@@ -281,11 +281,13 @@ class IsolinesRoutingConfig(ServiceConfig):
class InternalGeocoderConfig(ServiceConfig):
METRICS_LOG_KEY = 'geocoder_log_path'
PERIOD_END_DATE = 'period_end_date'
def __init__(self, redis_connection, db_conn, username, orgname=None):
# For now, internal geocoder doesn't use the redis config
super(InternalGeocoderConfig, self).__init__(None, db_conn,
super(InternalGeocoderConfig, self).__init__(redis_connection, db_conn,
username, orgname)
self._period_end_date = date_parse(self._redis_config[self.PERIOD_END_DATE])
@property
def service_type(self):
@@ -303,10 +305,23 @@ class InternalGeocoderConfig(ServiceConfig):
def geocoding_quota(self):
return None
@property
def monthly_quota(self):
return None
@property
def provider(self):
return 'internal'
@property
def period_end_date(self):
return self._period_end_date
@property
def soft_limit(self):
return False
class GeocoderConfig(ServiceConfig):