diff --git a/pyth_observer/__init__.py b/pyth_observer/__init__.py index 36d41ad..9eae72e 100644 --- a/pyth_observer/__init__.py +++ b/pyth_observer/__init__.py @@ -190,14 +190,14 @@ async def run(self): states.append(publisher_state) active_publishers_by_symbol[symbol]["count"] += 1 - metrics.price_feeds_processed.set(processed_feeds) + metrics.price_feeds_processed.set(processed_feeds) - for symbol, info in active_publishers_by_symbol.items(): - metrics.publishers_active.labels( - symbol=symbol, asset_type=info["asset_type"] - ).set(info["count"]) + for symbol, info in active_publishers_by_symbol.items(): + metrics.publishers_active.labels( + symbol=symbol, asset_type=info["asset_type"] + ).set(info["count"]) - await self.dispatch.run(states) + await self.dispatch.run(states) except Exception as e: logger.error(f"Error in run loop: {e}") diff --git a/pyth_observer/dispatch.py b/pyth_observer/dispatch.py index f6d0171..ee7a20b 100644 --- a/pyth_observer/dispatch.py +++ b/pyth_observer/dispatch.py @@ -32,6 +32,7 @@ class Dispatch: def __init__(self, config, publishers): self.config = config self.publishers = publishers + self.open_alerts = {} if "ZendutyEvent" in self.config["events"]: self.open_alerts_file = os.environ["OPEN_ALERTS_FILE"] self.open_alerts = self.load_alerts()