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

Method getOrCreateSourceManager

internal/server/server.go:1013–1026  ·  view source on GitHub ↗
(ctx context.Context, src snapshot.SourceInfo)

Source from the content-addressed store, hash-verified

1011}
1012
1013func (s *Server) getOrCreateSourceManager(ctx context.Context, src snapshot.SourceInfo) *sourceManager {
1014 s.serverMutex.Lock()
1015 defer s.serverMutex.Unlock()
1016
1017 if s.sourceManagers[src] == nil {
1018 userLog(ctx).Debugf("creating source manager for %v", src)
1019 sm := newSourceManager(src, s, s.rep)
1020 s.sourceManagers[src] = sm
1021
1022 sm.start(ctx, s.isLocal(src))
1023 }
1024
1025 return s.sourceManagers[src]
1026}
1027
1028func (s *Server) deleteSourceManager(ctx context.Context, src snapshot.SourceInfo) bool {
1029 s.serverMutex.Lock()

Callers

nothing calls this directly

Calls 5

isLocalMethod · 0.95
newSourceManagerFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
startMethod · 0.45

Tested by

no test coverage detected