Skip to content

Commit b0e38d2

Browse files
committed
fix precommit
1 parent 825f80e commit b0e38d2

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ignore_missing_imports = true
44

55
[tool.poetry]
66
name = "pyth-observer"
7-
version = "0.3.5"
7+
version = "2.1.4"
88
description = "Alerts and stuff"
99
authors = []
1010
readme = "README.md"

pyth_observer/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
)
1818
from throttler import Throttler
1919

20+
import pyth_observer.health_server as health_server
2021
from pyth_observer.check.price_feed import PriceFeedState
2122
from pyth_observer.check.publisher import PublisherState
2223
from pyth_observer.coingecko import Symbol, get_coingecko_prices
2324
from pyth_observer.crosschain import CrosschainPrice
2425
from pyth_observer.crosschain import CrosschainPriceObserver as Crosschain
2526
from pyth_observer.dispatch import Dispatch
2627
from pyth_observer.models import Publisher
27-
import pyth_observer.health_server as health_server
2828

2929
PYTHTEST_HTTP_ENDPOINT = "https://api.pythtest.pyth.network/"
3030
PYTHTEST_WS_ENDPOINT = "wss://api.pythtest.pyth.network/"
@@ -133,7 +133,9 @@ async def run(self):
133133
latest_trading_slot=price_account.last_slot,
134134
price_aggregate=price_account.aggregate_price_info.price,
135135
confidence_interval_aggregate=price_account.aggregate_price_info.confidence_interval,
136-
coingecko_price=coingecko_prices.get(product.attrs["base"]),
136+
coingecko_price=coingecko_prices.get(
137+
product.attrs["base"]
138+
),
137139
coingecko_update=coingecko_updates.get(
138140
product.attrs["base"]
139141
),

pyth_observer/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from prometheus_client import start_http_server
99

1010
from pyth_observer import Observer, Publisher
11-
from pyth_observer.models import ContactInfo
1211
from pyth_observer.health_server import start_health_server
12+
from pyth_observer.models import ContactInfo
1313

1414

1515
@click.command()
@@ -63,7 +63,7 @@ def run(config, publishers, coingecko_mapping, prometheus_port):
6363
start_http_server(int(prometheus_port))
6464

6565
async def main():
66-
health_task = asyncio.create_task(start_health_server())
66+
asyncio.create_task(start_health_server())
6767
await observer.run()
6868

6969
asyncio.run(main())

pyth_observer/health_server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import asyncio
2+
23
from aiohttp import web
34

45
observer_ready = False
56

7+
68
async def live_handler(request):
79
return web.Response(text="OK")
810

11+
912
async def ready_handler(request):
1013
if observer_ready:
1114
return web.Response(text="OK")
1215
else:
1316
return web.Response(status=503, text="Not Ready")
1417

18+
1519
async def start_health_server(port=8080):
1620
app = web.Application()
1721
app.router.add_get("/live", live_handler)
@@ -22,4 +26,3 @@ async def start_health_server(port=8080):
2226
await site.start()
2327
while True:
2428
await asyncio.sleep(3600)
25-

0 commit comments

Comments
 (0)