Add logger for the internal geocoder too
This commit is contained in:
@@ -134,7 +134,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -165,7 +165,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -196,7 +196,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -227,7 +227,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -258,7 +258,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -289,7 +289,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -320,7 +320,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -351,7 +351,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -382,7 +382,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -413,7 +413,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -444,7 +444,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -227,7 +227,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -278,7 +278,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -310,7 +310,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -395,7 +395,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -427,7 +427,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -459,7 +459,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -558,7 +558,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -589,7 +589,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -620,7 +620,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -651,7 +651,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -777,7 +777,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -5,7 +5,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -6,7 +6,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -38,7 +38,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -6,7 +6,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -38,7 +38,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -70,7 +70,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -5,7 +5,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -36,7 +36,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -67,7 +67,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
@@ -98,7 +98,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -5,7 +5,7 @@ RETURNS Geometry AS $$
|
||||
|
||||
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
|
||||
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metrics_connection']
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, username, orgname)
|
||||
user_geocoder_config = InternalGeocoderConfig(redis_conn, plpy, username, orgname)
|
||||
|
||||
quota_service = QuotaService(user_geocoder_config, redis_conn)
|
||||
try:
|
||||
|
||||
@@ -19,7 +19,19 @@ SELECT cartodb.cdb_conf_setconf('redis_metadata_config', '{"redis_host": "localh
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT cartodb.cdb_conf_setconf('mapzen_conf', '{"app_key": "dummy_key"}');
|
||||
SELECT cartodb.cdb_conf_setconf('heremaps_conf', '{"app_id": "dummy_id", "app_code": "dummy_code", "geocoder_cost_per_hit": 1}');
|
||||
cdb_conf_setconf
|
||||
------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT cartodb.cdb_conf_setconf('mapzen_conf', '{"routing_app_key": "dummy_key"}');
|
||||
cdb_conf_setconf
|
||||
------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT cartodb.cdb_conf_setconf('logger_conf', '{"geocoder_log_path": "/dev/null"}');
|
||||
cdb_conf_setconf
|
||||
------------------
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ CREATE EXTENSION cdb_dataservices_server;
|
||||
SELECT cartodb.cdb_conf_setconf('redis_metrics_config', '{"redis_host": "localhost", "redis_port": 6379, "timeout": 0.1, "redis_db": 5}');
|
||||
SELECT cartodb.cdb_conf_setconf('redis_metadata_config', '{"redis_host": "localhost", "redis_port": 6379, "timeout": 0.1, "redis_db": 5}');
|
||||
SELECT cartodb.cdb_conf_setconf('heremaps_conf', '{"app_id": "dummy_id", "app_code": "dummy_code", "geocoder_cost_per_hit": 1}');
|
||||
SELECT cartodb.cdb_conf_setconf('mapzen_conf', '{"app_key": "dummy_key"}');
|
||||
SELECT cartodb.cdb_conf_setconf('logger_conf', '{"geocoder_log_path": "/var/log/postgresql/geocodings.log"}');
|
||||
SELECT cartodb.cdb_conf_setconf('mapzen_conf', '{"routing_app_key": "dummy_key"}');
|
||||
SELECT cartodb.cdb_conf_setconf('logger_conf', '{"geocoder_log_path": "/dev/null"}');
|
||||
|
||||
-- Mock the varnish invalidation function
|
||||
-- (used by cdb_geocoder tests)
|
||||
|
||||
Reference in New Issue
Block a user