Skip to content

Commit ca4ed5c

Browse files
authored
fix(observer) Fix a bug where dispatcher is never called (#94)
1 parent 768d586 commit ca4ed5c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pyth_observer/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ async def run(self):
190190
states.append(publisher_state)
191191
active_publishers_by_symbol[symbol]["count"] += 1
192192

193-
metrics.price_feeds_processed.set(processed_feeds)
193+
metrics.price_feeds_processed.set(processed_feeds)
194194

195-
for symbol, info in active_publishers_by_symbol.items():
196-
metrics.publishers_active.labels(
197-
symbol=symbol, asset_type=info["asset_type"]
198-
).set(info["count"])
195+
for symbol, info in active_publishers_by_symbol.items():
196+
metrics.publishers_active.labels(
197+
symbol=symbol, asset_type=info["asset_type"]
198+
).set(info["count"])
199199

200-
await self.dispatch.run(states)
200+
await self.dispatch.run(states)
201201

202202
except Exception as e:
203203
logger.error(f"Error in run loop: {e}")

pyth_observer/dispatch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Dispatch:
3232
def __init__(self, config, publishers):
3333
self.config = config
3434
self.publishers = publishers
35+
self.open_alerts = {}
3536
if "ZendutyEvent" in self.config["events"]:
3637
self.open_alerts_file = os.environ["OPEN_ALERTS_FILE"]
3738
self.open_alerts = self.load_alerts()

0 commit comments

Comments
 (0)