Skip to content
Snippets Groups Projects
Commit eeec5901 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improve caching

parent 5e30ecd4
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment