mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
feat(supervisor): wire FIRMS adapter
- Add FIRMSAdapter import and factory case - Add CENTRAL_FIRE stream to STREAM_SUBJECTS Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a007418e0a
commit
5dbaf1dd5c
1 changed files with 781 additions and 773 deletions
|
|
@ -15,6 +15,7 @@ from nats.js import JetStreamContext
|
||||||
|
|
||||||
from central.adapter import SourceAdapter
|
from central.adapter import SourceAdapter
|
||||||
from central.adapters.nws import NWSAdapter
|
from central.adapters.nws import NWSAdapter
|
||||||
|
from central.adapters.firms import FIRMSAdapter
|
||||||
from central.cloudevents_wire import wrap_event
|
from central.cloudevents_wire import wrap_event
|
||||||
from central.config_models import AdapterConfig
|
from central.config_models import AdapterConfig
|
||||||
from central.config_source import ConfigSource, DbConfigSource
|
from central.config_source import ConfigSource, DbConfigSource
|
||||||
|
|
@ -29,6 +30,7 @@ CURSOR_DB_PATH = Path("/var/lib/central/cursors.db")
|
||||||
STREAM_SUBJECTS = {
|
STREAM_SUBJECTS = {
|
||||||
"CENTRAL_WX": ["central.wx.>"],
|
"CENTRAL_WX": ["central.wx.>"],
|
||||||
"CENTRAL_META": ["central.meta.>"],
|
"CENTRAL_META": ["central.meta.>"],
|
||||||
|
"CENTRAL_FIRE": ["central.fire.>"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recompute interval for stream max_bytes (1 hour)
|
# Recompute interval for stream max_bytes (1 hour)
|
||||||
|
|
@ -152,6 +154,12 @@ class Supervisor:
|
||||||
"""Create an adapter instance based on config name."""
|
"""Create an adapter instance based on config name."""
|
||||||
if config.name == "nws":
|
if config.name == "nws":
|
||||||
return NWSAdapter(config=config, cursor_db_path=CURSOR_DB_PATH)
|
return NWSAdapter(config=config, cursor_db_path=CURSOR_DB_PATH)
|
||||||
|
elif config.name == "firms":
|
||||||
|
return FIRMSAdapter(
|
||||||
|
config=config,
|
||||||
|
config_store=self._config_store,
|
||||||
|
cursor_db_path=CURSOR_DB_PATH,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown adapter type: {config.name}")
|
raise ValueError(f"Unknown adapter type: {config.name}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue