csc-sync-debian quickfix

pull/3/head
Andrew Wang 4 months ago
parent 7a3c8c1c93
commit 9f2cce23c8
  1. 12
      merlin/sync/process.go
  2. 16
      merlin/sync/sync.go

@ -99,12 +99,6 @@ func startRepoSync(repo *config.Repo) {
repo.Logger.Debug("Changes found; will attempt to sync")
}
args := getSyncCommand(repo)
if len(args) == 0 {
repo.Logger.Error("zero length command given for sync")
return
}
// clear the rsync log file before starting the sync
if repo.RsyncLogFile != "" {
err := os.Truncate(repo.RsyncLogFile, 0)
@ -113,6 +107,12 @@ func startRepoSync(repo *config.Repo) {
}
}
args := getSyncCommand(repo)
if len(args) == 0 {
repo.Logger.Error("zero length command given for sync")
return
}
ch := spawnProcess(repo, args)
if ch == nil {
// spawnSyncProcess will have already logged error

@ -198,10 +198,20 @@ func cscSyncDebian(repo *config.Repo) []string {
args = append(args, addConditionalFlags(repo, baseFlags|excludeTmp|ipv4)...)
args = append(args, buildRsyncDaemonHost(repo)+"/pool/", buildDownloadDir(repo)+"/pool/")
args = append(args, []string{
"&&", "nice", "rsync", "-rlHtvp",
ch := spawnProcess(repo, args)
if ch == nil {
// spawnSyncProcess will have already logged error
return nil
}
cmd := <-ch
if cmd.ProcessState.ExitCode() != 0 {
return nil
}
args = []string{
"nice", "rsync", "-rlHtvp",
"--exclude", filepath.Join("project/trace", config.Conf.Hostname),
}...)
}
args = append(args, addConditionalFlags(repo, baseFlags|excludeTmp|ipv4|delayUpdatesDeleteAfter)...)
args = append(args, buildRsyncDaemonHost(repo), buildDownloadDir(repo))

Loading…
Cancel
Save