fix(firms): use public is_published/mark_published methods

Match NWS adapter pattern for supervisor compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt Johnson 2026-05-16 20:03:34 +00:00
commit 22c50d3176
2 changed files with 7 additions and 7 deletions

View file

@ -175,7 +175,7 @@ class FIRMSAdapter(SourceAdapter):
self._db = None
logger.info("FIRMS adapter shut down")
def _is_published(self, stable_id: str) -> bool:
def is_published(self, stable_id: str) -> bool:
"""Check if an event has already been published."""
if not self._db:
return False
@ -185,7 +185,7 @@ class FIRMSAdapter(SourceAdapter):
)
return cur.fetchone() is not None
def _mark_published(self, stable_id: str) -> None:
def mark_published(self, stable_id: str) -> None:
"""Mark an event as published."""
if not self._db:
return
@ -383,12 +383,12 @@ class FIRMSAdapter(SourceAdapter):
row["longitude"],
)
if self._is_published(stable_id):
if self.is_published(stable_id):
continue
event = self._row_to_event(row, satellite)
yield event
self._mark_published(stable_id)
self.mark_published(stable_id)
new_count += 1
total_new += new_count

View file

@ -246,13 +246,13 @@ class TestDeduplication:
stable_id = "VIIRS_SNPP_NRT:2026-05-16:1430:45.123:-116.456"
# Not published initially
assert not adapter._is_published(stable_id)
assert not adapter.is_published(stable_id)
# Mark as published
adapter._mark_published(stable_id)
adapter.mark_published(stable_id)
# Now should be published
assert adapter._is_published(stable_id)
assert adapter.is_published(stable_id)
await adapter.shutdown()