From 69e4d863c4eea5f6b68d5a991c8cf543e2062ce8 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Thu, 7 Jun 2018 17:10:44 -0700 Subject: [PATCH] added datetime expiration to the trades table --- freqtrade/aws/trade.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/aws/trade.py b/freqtrade/aws/trade.py index 40316a6d5..93e227d9f 100644 --- a/freqtrade/aws/trade.py +++ b/freqtrade/aws/trade.py @@ -1,3 +1,4 @@ +import datetime from time import sleep import boto3 @@ -21,7 +22,7 @@ def store(event, context): for x in data: print("storing data: {}".format(x)) - sleep(0.5) # throttle to not overwhelm the DB, lambda is cheaper than dynamo + sleep(0.5) # throttle to not overwhelm the DB, lambda is cheaper than dynamo get_trade_table().put_item(Item=x) @@ -35,6 +36,7 @@ def submit(event, context): print(event) data = json.loads(event['body']) + data['ttl'] = (datetime.datetime.today() + datetime.timedelta(days=1)).timestamp() client = boto3.client('sns') topic_arn = client.create_topic(Name=os.environ['tradeTopic'])['TopicArn']