(ctx context.Context, srv *server.Server)
| 180 | } |
| 181 | |
| 182 | func (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 | |
| 199 | func (c *commandServerStart) run(ctx context.Context) (reterr error) { |
| 200 | if err := insecureserverbind.ValidateListenAddressIfRestricted( |
no test coverage detected