service
service
¶
Refresher service for BigBrotr.
Periodically refreshes materialized views in dependency order. Each view is refreshed individually via Brotr.refresh_materialized_view(), providing per-view logging, timing, and error isolation.
The default view list and ordering is defined in
DEFAULT_VIEWS and
respects the 3-level dependency chain:
relay_metadata_latest(base dependency for software/NIP views)- Independent statistics views (
event_stats,relay_stats, etc.) - Views depending on
relay_metadata_latest(relay_software_counts,supported_nip_counts)
See Also
RefresherConfig:
Configuration model for view list and scheduling.
BaseService: Abstract base
class providing run() and run_forever() lifecycle.
Brotr.refresh_materialized_view():
Database method that calls the underlying refresh stored procedure.
Examples:
from bigbrotr.core import Brotr
from bigbrotr.services import Refresher
brotr = Brotr.from_yaml("config/brotr.yaml")
refresher = Refresher.from_yaml("config/services/refresher.yaml", brotr=brotr)
async with brotr:
async with refresher:
await refresher.run_forever()
Classes¶
Refresher
¶
Refresher(brotr: Brotr, config: ConfigT | None = None)
Bases: BaseService[RefresherConfig]
Materialized view refresh service.
Iterates over the configured view list and refreshes each view individually. Failures on one view do not prevent subsequent views from being refreshed.
See Also
RefresherConfig: Configuration model for this service.
Source code in src/bigbrotr/core/base_service.py
Functions¶
run
async
¶
Execute one refresh cycle over all configured views.