Skip to content

Commit 75ea14d

Browse files
committed
Fixed logging messages.
1 parent f276dd4 commit 75ea14d

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

eoapi_notifier/sources/pgstac.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,8 @@ async def start(self) -> None:
488488

489489
correlation_mode = "with correlation" if self._correlator else "raw events only"
490490
self.logger.info(
491-
"Starting pgSTAC source (%s): %s",
492-
correlation_mode,
493-
self.config.get_connection_info(),
491+
f"Starting pgSTAC source ({correlation_mode}): "
492+
f"{self.config.get_connection_info()}"
494493
)
495494

496495
self.logger.debug("Step 1: Establishing database connection...")
@@ -559,10 +558,8 @@ async def _establish_connection(self) -> None:
559558
self._current_delay = self.config.reconnect_delay
560559

561560
self.logger.info(
562-
"✓ Connected to pgSTAC database at %s:%s/%s",
563-
self.config.host,
564-
self.config.port,
565-
self.config.database,
561+
f"✓ Connected to pgSTAC database at "
562+
f"{self.config.host}:{self.config.port}/{self.config.database}"
566563
)
567564

568565
except Exception as e:
@@ -613,7 +610,7 @@ async def _setup_listener(self) -> None:
613610
self.config.channel, self._handle_notification
614611
)
615612

616-
self.logger.info("✓ Listening on channel: %s", self.config.channel)
613+
self.logger.info(f"✓ Listening on channel: {self.config.channel}")
617614

618615
async def _cleanup_connection(self) -> None:
619616
"""Clean up database connection and listener."""
@@ -703,7 +700,11 @@ async def _process_notifications(self) -> None:
703700
)
704701

705702
def _handle_notification(
706-
self, connection: asyncpg.Connection, pid: int, channel: str, payload: str
703+
self,
704+
connection: asyncpg.Connection,
705+
pid: int,
706+
channel: str,
707+
payload: str,
707708
) -> None:
708709
"""Handle incoming PostgreSQL notification."""
709710
self.logger.debug(
@@ -782,7 +783,9 @@ def _create_notification_event(self, payload: str) -> NotificationEvent | None:
782783

783784
except (json.JSONDecodeError, KeyError) as e:
784785
self.logger.error(
785-
"✗ Invalid notification payload: %s - payload was: %s", e, payload
786+
"✗ Invalid notification payload: %s - payload was: %s",
787+
e,
788+
payload,
786789
)
787790
return None
788791

@@ -796,7 +799,9 @@ async def _raw_event_stream(self) -> AsyncIterator[NotificationEvent]:
796799
event = await asyncio.wait_for(self._event_queue.get(), timeout=1.0)
797800
event_stream_count += 1
798801
self.logger.debug(
799-
"Streaming event #%d from queue: %s", event_stream_count, event.id
802+
"Streaming event #%d from queue: %s",
803+
event_stream_count,
804+
event.id,
800805
)
801806
yield event
802807
except TimeoutError:

helm-chart/eoapi-notifier/templates/configmap.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,7 @@ data:
1212
{{- range .Values.config.sources}}
1313
- type: {{.type}}
1414
config:
15-
{{- if eq .type "pgstac"}}
16-
# Connection details provided via environment variables
17-
host: localhost
18-
port: 5432
19-
database: postgis
20-
user: postgres
21-
password: password
22-
{{- else}}
2315
{{- toYaml .config | nindent 10}}
24-
{{- end}}
2516
{{- end}}
2617
2718
outputs:

0 commit comments

Comments
 (0)