Remove Data Observatory functions

This commit is contained in:
Jesús Arroyo Torrens
2021-03-03 16:22:38 +01:00
parent 2b98908dbc
commit f4d8ebab44
15 changed files with 6 additions and 2092 deletions

View File

@@ -89,17 +89,3 @@ RETURNS boolean AS $$
GD[cache_key] = routing_config
return True
$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER;
CREATE OR REPLACE FUNCTION cdb_dataservices_server._get_obs_config(username text, orgname text)
RETURNS boolean AS $$
cache_key = "user_obs_config_{0}".format(username)
if cache_key in GD:
return False
else:
from cartodb_services.metrics import ObservatoryConfig
plpy.execute("SELECT cdb_dataservices_server._connect_to_redis('{0}')".format(username))
redis_conn = GD["redis_connection_{0}".format(username)]['redis_metadata_connection']
obs_config = ObservatoryConfig(redis_conn, plpy, username, orgname)
GD[cache_key] = obs_config
return True
$$ LANGUAGE @@plpythonu@@ SECURITY DEFINER STABLE PARALLEL RESTRICTED;