From 17fd3f752d5e37df906abddf1f13fd7ad1de6c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 21 Apr 2018 10:44:16 +0200 Subject: Add latest date to redis --- market.py | 2 ++ tests/test_market.py | 1 + 2 files changed, 3 insertions(+) diff --git a/market.py b/market.py index ce0c48c..ce41841 100644 --- a/market.py +++ b/market.py @@ -85,6 +85,8 @@ class Market: conn.set(key, log, ex=31*24*60*60) key = "/cryptoportfolio/{}/latest/{}".format(self.market_id, type_) conn.set(key, log) + key = "/cryptoportfolio/{}/latest/date".format(self.market_id) + conn.set(key, date.isoformat()) except Exception as e: print("impossible to store report to redis: {}; {}".format(e.__class__.__name__, e)) diff --git a/tests/test_market.py b/tests/test_market.py index e3482b8..e0cf70a 100644 --- a/tests/test_market.py +++ b/tests/test_market.py @@ -550,6 +550,7 @@ class MarketTest(WebMockTestCase): mock.call.set("/cryptoportfolio/1/latest/type1", "payload1"), mock.call.set("/cryptoportfolio/1/2018-03-24T00:00:00/type2", "payload2", ex=31*24*60*60), mock.call.set("/cryptoportfolio/1/latest/type2", "payload2"), + mock.call.set("/cryptoportfolio/1/latest/date", "2018-03-24T00:00:00"), ]) connect_mock.reset_mock() -- cgit v1.2.3