diff --git a/routes/compat/wakatime/v1/summaries.go b/routes/compat/wakatime/v1/summaries.go index a4bda99..9dc4a27 100644 --- a/routes/compat/wakatime/v1/summaries.go +++ b/routes/compat/wakatime/v1/summaries.go @@ -121,17 +121,16 @@ func (h *SummariesHandler) loadUserSummaries(r *http.Request) ([]*models.Summary end = utils.EndOfDay(end).Add(-1 * time.Second) overallParams := &models.SummaryParams{ - From: start, - To: end, - User: user, - Recompute: false, + From: start, + To: end, + User: user, } intervals := utils.SplitRangeByDays(overallParams.From, overallParams.To) summaries := make([]*models.Summary, len(intervals)) for i, interval := range intervals { - summary, err := h.summarySrvc.Aliased(interval[0], interval[1], user, h.summarySrvc.Retrieve, false) + summary, err := h.summarySrvc.Aliased(interval[0], interval[1], user, h.summarySrvc.Retrieve, end.After(time.Now())) if err != nil { return nil, err, http.StatusInternalServerError } diff --git a/services/summary.go b/services/summary.go index 63ea5aa..a0005e2 100644 --- a/services/summary.go +++ b/services/summary.go @@ -73,12 +73,6 @@ func (srv *SummaryService) Aliased(from, to time.Time, user *models.User, f Summ } func (srv *SummaryService) Retrieve(from, to time.Time, user *models.User) (*models.Summary, error) { - // Check cache - cacheKey := srv.getHash(from.String(), to.String(), user.ID) - if cacheResult, ok := srv.cache.Get(cacheKey); ok { - return cacheResult.(*models.Summary), nil - } - // Get all already existing, pre-generated summaries that fall into the requested interval summaries, err := srv.repository.GetByUserWithin(user, from, to) if err != nil { @@ -101,8 +95,6 @@ func (srv *SummaryService) Retrieve(from, to time.Time, user *models.User) (*mod return nil, err } - // Cache 'em - srv.cache.SetDefault(cacheKey, summary) return summary.Sorted(), nil } diff --git a/version.txt b/version.txt index 450a687..bf4df28 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.28.1 +1.28.2