MCPcopy
hub / github.com/tuna/tunasync / Start

Method Start

worker/rsync_provider.go:153–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153func (p *rsyncProvider) Start() error {
154 p.Lock()
155 defer p.Unlock()
156
157 if p.IsRunning() {
158 return errors.New("provider is currently running")
159 }
160
161 command := []string{p.rsyncCmd}
162 command = append(command, p.options...)
163 command = append(command, p.upstreamURL, p.WorkingDir())
164
165 p.cmd = newCmdJob(p, command, p.WorkingDir(), p.rsyncEnv)
166 if err := p.prepareLogFile(false); err != nil {
167 return err
168 }
169
170 if err := p.cmd.Start(); err != nil {
171 return err
172 }
173 p.isRunning.Store(true)
174 logger.Debugf("set isRunning to true: %s", p.Name())
175 return nil
176}

Callers 1

RunMethod · 0.95

Calls 7

newCmdJobFunction · 0.85
prepareLogFileMethod · 0.80
DebugfMethod · 0.80
IsRunningMethod · 0.65
WorkingDirMethod · 0.65
StartMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected