From eeec5901368ba8292392cf916403759b092fa7af Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Sat, 4 May 2019 19:11:51 +0200
Subject: [PATCH] Improve caching

---
 client.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/client.go b/client.go
index 6a896bd..6100db5 100644
--- a/client.go
+++ b/client.go
@@ -22,6 +22,7 @@ type ApiClient struct {
 }
 
 const cacheTimestamp = "2006-01-02T15:04"
+const cacheTimestampDate = "2006-01-02"
 
 func (c *ApiClient) Station(evaId int64) ([]Station, error) {
 	key := fmt.Sprintf("realtime_recent %d", evaId)
@@ -311,7 +312,7 @@ func (c *ApiClient) loadCoachSequence(line string, date time.Time) (CoachSequenc
 }
 
 func (c *ApiClient) Suggestions(line string, date time.Time) ([]Suggestion, error) {
-	key := fmt.Sprintf("suggestions %s %s", line, date.Format(cacheTimestamp))
+	key := fmt.Sprintf("suggestions %s %s", line, date.Format(cacheTimestampDate))
 
 	var result []Suggestion
 	for _, cache := range c.Caches {
-- 
GitLab