|
|
@ -53,7 +53,7 @@ class Client: |
|
|
|
info(f"check backend every {timeout} seconds") |
|
|
|
while True: |
|
|
|
await self.backend.pulse(True) |
|
|
|
await self.update_prices_from_server() |
|
|
|
await self.update_prices_from_server(True) |
|
|
|
await asyncio.sleep(timeout) |
|
|
|
|
|
|
|
def build_handler(self): |
|
|
@ -92,9 +92,9 @@ class Client: |
|
|
|
info(f"Add vip {steam2}, amount {seconds}") |
|
|
|
await self.backend.vip(steam2, seconds, f"rub={int(money)};", unique=f"qiwi_{t.id}") |
|
|
|
|
|
|
|
async def update_prices_from_server(self): |
|
|
|
async def update_prices_from_server(self, exit_if_error = True): |
|
|
|
#info("Fetch prices from server backend") |
|
|
|
prices = await self.backend.prices() |
|
|
|
prices = await self.backend.prices(exit_if_error) |
|
|
|
self.update_prices(prices) |
|
|
|
|
|
|
|
def update_prices(self, prices): |
|
|
|