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:
@@ -281,11 +281,13 @@ class IsolinesRoutingConfig(ServiceConfig):
|
|||||||
class InternalGeocoderConfig(ServiceConfig):
|
class InternalGeocoderConfig(ServiceConfig):
|
||||||
|
|
||||||
METRICS_LOG_KEY = 'geocoder_log_path'
|
METRICS_LOG_KEY = 'geocoder_log_path'
|
||||||
|
PERIOD_END_DATE = 'period_end_date'
|
||||||
|
|
||||||
def __init__(self, redis_connection, db_conn, username, orgname=None):
|
def __init__(self, redis_connection, db_conn, username, orgname=None):
|
||||||
# For now, internal geocoder doesn't use the redis config
|
# 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)
|
username, orgname)
|
||||||
|
self._period_end_date = date_parse(self._redis_config[self.PERIOD_END_DATE])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def service_type(self):
|
def service_type(self):
|
||||||
@@ -303,10 +305,23 @@ class InternalGeocoderConfig(ServiceConfig):
|
|||||||
def geocoding_quota(self):
|
def geocoding_quota(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def monthly_quota(self):
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def provider(self):
|
def provider(self):
|
||||||
return 'internal'
|
return 'internal'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def period_end_date(self):
|
||||||
|
return self._period_end_date
|
||||||
|
|
||||||
|
@property
|
||||||
|
def soft_limit(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GeocoderConfig(ServiceConfig):
|
class GeocoderConfig(ServiceConfig):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user