Skip to content

Commit

Permalink
Fix reporter (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
unanoc authored Nov 24, 2021
1 parent f7da40b commit 3d10894
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
6 changes: 0 additions & 6 deletions src/processor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ func (s *Service) RunSanityCheck(paths []string) error {
}
}

err := s.reporterService.Update(reportSanityCheckKey, report)
if err != nil {
log.WithError(err).Error()
return err
}

return nil
}

Expand Down
21 changes: 0 additions & 21 deletions src/reporter/service.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package reporter

import (
"fmt"
"sync"
)

Expand Down Expand Up @@ -30,26 +29,6 @@ func (s *Service) GetOrNew(name string) *Report {
return s.reports[name]
}

func (s *Service) Update(key string, report *Report) error {
s.mu.Lock()
defer s.mu.Unlock()

if report == nil {
return fmt.Errorf("report param cannot be nil")
}

if r, ok := s.reports[key]; ok {
r.Fixed += report.Fixed
r.Errors += report.Errors
r.Warnings += report.Warnings
r.TotalFiles += report.TotalFiles
}

s.reports[key] = report

return nil
}

func (s *Service) GetReports() ReportList {
s.mu.Lock()
defer s.mu.Unlock()
Expand Down

0 comments on commit 3d10894

Please sign in to comment.