Await task HistoricalPriceTask._load() and adjust Dockerfile to expose

port 1337
This commit is contained in:
dsc 2020-12-22 19:29:17 +01:00
parent 134d897b8a
commit 28fdf41aad
2 changed files with 3 additions and 2 deletions

View File

@ -7,4 +7,4 @@ RUN pip install -r requirements.txt
COPY . .
EXPOSE 1337
CMD ["hypercorn", "--access-logfile", "-", "--workers", "1", "--bind", "0.0.0.0:18200", "asgi:app"]
CMD ["hypercorn", "--access-logfile", "-", "--workers", "1", "--bind", "0.0.0.0:1337", "asgi:app"]

View File

@ -2,6 +2,7 @@
# Copyright (c) 2020, The Monero Project.
# Copyright (c) 2020, dsc@xmr.pm
import asyncio
import os
import json
from typing import List, Union
@ -33,7 +34,7 @@ class HistoricalPriceTask(FeatherTask):
self._year_genesis = int(settings.COIN_GENESIS_DATE[:4])
self._load()
asyncio.create_task(self._load())
async def task(self) -> Union[dict, None]:
content = await httpget(self._http_endpoint, json=True, raise_for_status=False)