mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
add error handling
This commit is contained in:
+8
-5
@@ -42,9 +42,12 @@ with open("models.json", "r") as f:
|
||||
|
||||
async def update_sats_pricing() -> None:
|
||||
while True:
|
||||
sats_to_usd = await sats_usd_ask_price()
|
||||
for model in MODELS:
|
||||
model.sats_pricing = Pricing(
|
||||
**{k: v / sats_to_usd for k, v in model.pricing.dict().items()}
|
||||
)
|
||||
try:
|
||||
sats_to_usd = await sats_usd_ask_price()
|
||||
for model in MODELS:
|
||||
model.sats_pricing = Pricing(
|
||||
**{k: v / sats_to_usd for k, v in model.pricing.dict().items()}
|
||||
)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
await asyncio.sleep(10)
|
||||
|
||||
Reference in New Issue
Block a user