MCPcopy Index your code
hub / github.com/kopia/kopia / pause

Method pause

internal/server/source_manager.go:272–287  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

270}
271
272func (s *sourceManager) pause(ctx context.Context) serverapi.SourceActionResponse {
273 userLog(ctx).Debugw("pause triggered via API", "source", s.src)
274
275 s.sourceMutex.Lock()
276 s.paused = true
277 s.sourceMutex.Unlock()
278
279 if u := s.currentUploader(); u != nil {
280 userLog(ctx).Info("canceling current upload")
281 u.Cancel()
282 }
283
284 s.server.refreshScheduler("source paused")
285
286 return serverapi.SourceActionResponse{Success: true}
287}
288
289func (s *sourceManager) resume(ctx context.Context) serverapi.SourceActionResponse {
290 userLog(ctx).Debugw("resume triggered via API", "source", s.src)

Callers

nothing calls this directly

Calls 6

currentUploaderMethod · 0.95
InfoMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
CancelMethod · 0.65
refreshSchedulerMethod · 0.65

Tested by

no test coverage detected