From 8b9a9a1a42e420b93a43af47a65068748ae23a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Mon, 19 Apr 2021 21:14:35 +0200 Subject: [PATCH] fix: merge summaries by unique from date only --- services/summary.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/summary.go b/services/summary.go index f9cf59e..ad29079 100644 --- a/services/summary.go +++ b/services/summary.go @@ -237,10 +237,10 @@ func (srv *SummaryService) mergeSummaries(summaries []*models.Summary) (*models. Machines: make([]*models.SummaryItem, 0), } - var processed = map[int64]bool{} + var processed = map[time.Time]bool{} for _, s := range summaries { - hash := s.FromTime.T().UnixNano() ^ s.ToTime.T().UnixNano() + hash := s.FromTime.T() if _, found := processed[hash]; found { logbuch.Warn("summary from %v to %v (user '%s') was attempted to be processed more often than once", s.FromTime, s.ToTime, s.UserID) continue