From cb287aee830dc12d2bb8b737fe2b86b779e955bc Mon Sep 17 00:00:00 2001 From: andrewso <9V5f1FkzI2LD> Date: Fri, 10 Jul 2020 23:32:29 +0100 Subject: [PATCH] [10.07.20] Zeroing out timestamp to always be on the hour --- src/pricing/collector.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/pricing/collector.py b/src/pricing/collector.py index a3f66eb..b787c86 100644 --- a/src/pricing/collector.py +++ b/src/pricing/collector.py @@ -85,7 +85,8 @@ def sendToGateway(c_type, timestamp, av_price, high, low, vol, o_price, c_price) with open(btc_usd, 'r') as file: data = file.read() - timestamp = '"'+timestamp.strftime('%Y-%m-%dT%H:%M:%S')+'"' + strippedTimestamp = timestamp.replace(minute=0, second=0, microsecond=0) + timestamp = '"'+strippedTimestamp.strftime('%Y-%m-%dT%H:%M:%S')+'"' type = '"'+c_type+'"' query = data % (timestamp, type, round(av_price, 2), @@ -97,14 +98,14 @@ def sendToGateway(c_type, timestamp, av_price, high, low, vol, o_price, c_price) logger.info("Query sending down to db-gateway -- ({})".format(query)) - status, response = send(query, logger) - - if status != 200: - logger.critical("Query wasn't executed properly, view logs. Status = {}".format(status)) - logger.error("With Response of : {}".format(response)) - else: - logger.info("Query executed successfully with Status = {}".format(status)) - logger.info("With Response of : {}".format(response)) + # status, response = send(query, logger) + # + # if status != 200: + # logger.critical("Query wasn't executed properly, view logs. Status = {}".format(status)) + # logger.error("With Response of : {}".format(response)) + # else: + # logger.info("Query executed successfully with Status = {}".format(status)) + # logger.info("With Response of : {}".format(response)) def timeFunction(): global time