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
Comment on dir translation
  • Loading branch information
ammario committed Apr 24, 2020
commit b0c4bc36083b6057a58522221998cea94b4f57ae
2 changes: 0 additions & 2 deletions internal/sync/eventcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ func (cache eventCache) Add(ev timedEvent) {
log.Info("ignored Create then Remove")
return
}
}
if ok {
log.Info("replaced %s with %s", lastEvent.Event(), ev.Event())
}
// Only let the latest event for a path have action.
Expand Down
2 changes: 2 additions & 0 deletions internal/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func (s Sync) initSync() error {

start := time.Now()
// Delete old files on initial sync (e.g git checkout).
// Add the "/." to the local directory so rsync doesn't try to place the directory
// into the remote dir.
err := s.syncPaths(true, s.LocalDir+"/.", s.RemoteDir)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't hurt to comment on why this is necessary

if err == nil {
flog.Success("finished initial sync (%v)", time.Since(start).Truncate(time.Millisecond))
Expand Down