Commit dd43c584 authored by Sebastian Stark's avatar Sebastian Stark

make every rsync command at least 1 second long

  - otherwise, if reusing an incomplete snapshot, the rename operation
  would fail because old and new name are the same
  - this would only happen if rsync runs less than a second, so normally
  in some error case
  - the 1 second sleep makes sense because 1 second is the resolution of
  the snapshot names
parent c8c761c6
......@@ -12,6 +12,7 @@ import (
"os/signal"
"path/filepath"
"syscall"
"time"
)
// createRsyncCommand returns an exec.Command structure that, when executed,
......@@ -47,6 +48,7 @@ func runRsyncCommand(cmd *exec.Cmd) (chan error, error) {
}
done := make(chan error)
go func() {
time.Sleep(time.Second)
done <- cmd.Wait()
return
}()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment