MCPcopy
hub / github.com/kopia/kopia / initRepositoryPossiblyAsync

Method initRepositoryPossiblyAsync

cli/command_server_start.go:182–197  ·  view source on GitHub ↗
(ctx context.Context, srv *server.Server)

Source from the content-addressed store, hash-verified

180}
181
182func (c *commandServerStart) initRepositoryPossiblyAsync(ctx context.Context, srv *server.Server) error {
183 initialize := func(ctx context.Context) (repo.Repository, error) {
184 return c.svc.openRepository(ctx, false)
185 }
186
187 if c.asyncRepoConnect {
188 // retry initialization indefinitely
189 initialize = server.RetryInitRepository(initialize)
190 }
191
192 if _, err := srv.InitRepositoryAsync(ctx, "Open", initialize, !c.asyncRepoConnect); err != nil {
193 return errors.Wrap(err, "unable to initialize repository")
194 }
195
196 return nil
197}
198
199func (c *commandServerStart) run(ctx context.Context) (reterr error) {
200 if err := insecureserverbind.ValidateListenAddressIfRestricted(

Callers 1

runMethod · 0.95

Calls 3

RetryInitRepositoryFunction · 0.92
openRepositoryMethod · 0.65
InitRepositoryAsyncMethod · 0.65

Tested by

no test coverage detected