From b41f2b8f7f1bee4057bd054d332e8a3f88b5c9f9 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 9 May 2022 08:02:38 +0100 Subject: [PATCH] Simplify cast for writing to ES --- handler/sources/local.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/sources/local.py b/handler/sources/local.py index 6377216..7a3f5fe 100644 --- a/handler/sources/local.py +++ b/handler/sources/local.py @@ -436,11 +436,11 @@ class Local(util.Base): "asset": ad[4], "currency": ad[5], "margin": ad[6], + "type": msgtype, + "ts": str(datetime.now().isoformat()), + "xtype": "platform", + "market": self.platform, } - cast["type"] = msgtype - cast["ts"] = str(datetime.now().isoformat()) - cast["xtype"] = "platorm" - cast["market"] = self.platform self.es.index(index=settings.ES.MetaIndex, document=cast) @inlineCallbacks