Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/devspace/services/sync/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,21 @@ func (c *controller) startWithWait(ctx devspacecontext.Context, options *Options
}
return nil
})
} else {
// For noWatch syncs: emit sync:stop when context is cancelled or sync
// completes, but do NOT kill the parent tomb (to avoid breaking SSH).
parent.Go(func() error {
select {
case <-ctx.Context().Done():
case <-onDone:
}
client.Stop(nil)
hook.LogExecuteHooks(ctx.WithLogger(options.SyncLog), map[string]interface{}{
"sync_config": options.SyncConfig,
}, hook.EventsForSingle("stop:sync", options.Name).With("sync.stop")...)
ctx.Log().Debugf("Stopped sync %s", options.SyncConfig.Path)
return nil
})
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/devspace/services/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func startSync(ctx devspacecontext.Context, name, arch string, syncConfig *lates
Arch: arch,
Starter: starter,

RestartOnError: true,
RestartOnError: !syncConfig.NoWatch,
Verbose: ctx.Log().GetLevel() == logrus.DebugLevel,
}

Expand Down