MCPcopy
hub / github.com/kopia/kopia / getTotalContentCount

Method getTotalContentCount

cli/command_content_verify.go:106–125  ·  view source on GitHub ↗
(ctx context.Context, rep repo.DirectRepository, totalCount *atomic.Int32)

Source from the content-addressed store, hash-verified

104}
105
106func (c *commandContentVerify) getTotalContentCount(ctx context.Context, rep repo.DirectRepository, totalCount *atomic.Int32) {
107 var tc int32
108
109 if err := rep.ContentReader().IterateContents(ctx, content.IterateOptions{
110 Range: c.contentRange.contentIDRange(),
111 IncludeDeleted: c.contentVerifyIncludeDeleted,
112 }, func(_ content.Info) error {
113 if err := ctx.Err(); err != nil {
114 return errors.Wrap(err, "context error")
115 }
116
117 tc++
118 return nil
119 }); err != nil {
120 log(ctx).Debugf("error estimating content count: %v", err)
121 return
122 }
123
124 totalCount.Store(tc)
125}

Callers 1

runMethod · 0.95

Calls 5

contentIDRangeMethod · 0.80
ErrMethod · 0.80
IterateContentsMethod · 0.65
ContentReaderMethod · 0.65
StoreMethod · 0.65

Tested by

no test coverage detected