From f7603f5a13dd6df7cc465b23a9ee3983a375f32d Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 25 Feb 2022 00:06:10 +0000 Subject: [PATCH] Fix errors and don't print ES logging --- handler/agora.py | 1 + handler/transactions.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/handler/agora.py b/handler/agora.py index cdc3d75..810b754 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -10,6 +10,7 @@ from agoradesk_py import AgoraDesk from pycoingecko import CoinGeckoAPI # TODO: remove this import and defer to money from time import sleep from pyotp import TOTP +from datetime import datetime # Project imports from settings import settings diff --git a/handler/transactions.py b/handler/transactions.py index 1fc98ef..b2e861f 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -10,6 +10,7 @@ from string import ascii_uppercase from elasticsearch import Elasticsearch from datetime import datetime import urllib3 +import logging # Project imports from settings import settings @@ -19,6 +20,11 @@ from util import convert # TODO: secure ES traffic properly urllib3.disable_warnings() +tracer = logging.getLogger("elasticsearch") +tracer.setLevel(logging.CRITICAL) +tracer = logging.getLogger("elastic_transport.transport") +tracer.setLevel(logging.CRITICAL) + class Transactions(object): """ @@ -46,8 +52,8 @@ class Transactions(object): """ deferToThread(self.get_total) deferToThread(self.get_remaining) - deferToThread(self.get_profit) - deferToThread(self.get_profit, True) + deferToThread(self.money.get_profit) + deferToThread(self.money.get_profit, True) deferToThread(self.get_open_trades_usd) deferToThread(self.get_total_remaining) deferToThread(self.get_total_with_trades)