From 58e0ab5ac0b0a6d7d3859edc5c59ee633881a351 Mon Sep 17 00:00:00 2001 From: "Miroslav Chomut (CZ)" Date: Mon, 30 Jun 2025 13:12:12 +0200 Subject: [PATCH 1/2] #42-No-Postgres-error --- src/writer_postgres.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/writer_postgres.py b/src/writer_postgres.py index 6d1d929..f2440ca 100644 --- a/src/writer_postgres.py +++ b/src/writer_postgres.py @@ -18,6 +18,8 @@ def init(logger): aws_secrets = boto3.Session().client(service_name='secretsmanager', region_name=secret_region) postgres_secret = aws_secrets.get_secret_value(SecretId=secret_name)["SecretString"] POSTGRES = json.loads(postgres_secret) + else: + POSTGRES = {"database": ""} _logger.debug("Initialized POSTGRES writer") From 2277f2fdb6aa829fe9a3941a4f0b20a7882c3dfb Mon Sep 17 00:00:00 2001 From: "Miroslav Chomut (CZ)" Date: Mon, 30 Jun 2025 13:22:08 +0200 Subject: [PATCH 2/2] bad return type --- src/writer_postgres.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/writer_postgres.py b/src/writer_postgres.py index f2440ca..971172b 100644 --- a/src/writer_postgres.py +++ b/src/writer_postgres.py @@ -143,7 +143,7 @@ def write(topicName, message): try: if not POSTGRES["database"]: _logger.debug("No Postgres - skipping") - return + return True with psycopg2.connect( database=POSTGRES["database"],