Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Speed up event processing #8

Merged
merged 12 commits into from
Apr 24, 2020
Prev Previous commit
Next Next commit
Improve replace message
  • Loading branch information
ammario committed Apr 24, 2020
commit c2ca1ea11aa529ce1e95ba1af58fe3c3d0bb7537
2 changes: 1 addition & 1 deletion internal/sync/eventcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (cache eventCache) Add(ev timedEvent) {
}
}
if ok {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be merged with the if statement above

log.Info("ignored duplicate event (%s replaced by %s)", lastEvent.Event(), ev.Event())
log.Info("replaced %s with %s", lastEvent.Event(), ev.Event())
}
// Only let the latest event for a path have action.
cache[ev.Path()] = ev
Expand Down
1 change: 0 additions & 1 deletion internal/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ func (s Sync) Run() error {
if time.Since(eventGroup[0].CreatedAt) > maxEventDelay {
return ErrRestartSync
}

s.workEventGroup(eventGroup)
eventGroup = eventGroup[:0]
}
Expand Down