1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: merge summaries by unique from date only

This commit is contained in:
Ferdinand Mütsch 2021-04-19 21:14:35 +02:00
parent 6576837396
commit 8b9a9a1a42

View File

@ -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