|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import psycopg2
|
|
|
|
|
from src.config import DATABASE_HOSTNAME, DATABASE_PORT, COLLECTOR_HOSTNAME, COLLECTOR_PORT
|
|
|
|
|
|
|
|
|
|
def get_production_connection():
|
|
|
|
|
try:
|
|
|
|
|
@ -7,8 +8,8 @@ def get_production_connection():
|
|
|
|
|
dbname="digital_twin",
|
|
|
|
|
user="digital_twin",
|
|
|
|
|
password="Pr0jec7@D!g!tTwiN",
|
|
|
|
|
host="192.168.1.82",
|
|
|
|
|
port="1111",
|
|
|
|
|
host={COLLECTOR_HOSTNAME},
|
|
|
|
|
port={COLLECTOR_PORT},
|
|
|
|
|
)
|
|
|
|
|
return production_connection
|
|
|
|
|
except Exception as e:
|
|
|
|
|
@ -30,15 +31,15 @@ def get_connection():
|
|
|
|
|
dbname="digital_twin",
|
|
|
|
|
user="postgres",
|
|
|
|
|
password="postgres",
|
|
|
|
|
host="192.168.1.85",
|
|
|
|
|
port="5432",
|
|
|
|
|
host={DATABASE_HOSTNAME},
|
|
|
|
|
port={DATABASE_PORT},
|
|
|
|
|
)
|
|
|
|
|
connection_wo_db = psycopg2.connect(
|
|
|
|
|
dbname="digital_twin",
|
|
|
|
|
user="postgres",
|
|
|
|
|
password="postgres",
|
|
|
|
|
host="192.168.1.86",
|
|
|
|
|
port="5432",
|
|
|
|
|
host={COLLECTOR_HOSTNAME},
|
|
|
|
|
port={COLLECTOR_PORT},
|
|
|
|
|
)
|
|
|
|
|
return connection, connection_wo_db
|
|
|
|
|
except Exception as e:
|
|
|
|
|
|