From be3b97ae421cde6b9303fab88dcd8cb2f46281a8 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 5 May 2022 18:26:25 +0100 Subject: [PATCH] Re-add write_to_es function --- handler/lib/money.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/handler/lib/money.py b/handler/lib/money.py index ffe8208..2d10a66 100644 --- a/handler/lib/money.py +++ b/handler/lib/money.py @@ -68,6 +68,13 @@ class Money(util.Base): self.lc_es_checks.start(delay) self.agora.es = self.es + def write_to_es(self, msgtype, cast): + if settings.ES.Enabled == "1": + cast["type"] = msgtype + cast["ts"] = str(datetime.now().isoformat()) + cast["xtype"] = "tx" + self.es.index(index=settings.ES.Index, document=cast) + def lookup_rates(self, platform, ads, rates=None): """ Lookup the rates for a list of public ads.