(ctx context.Context, rep repo.DirectRepository, totalCount *atomic.Int32)
| 104 | } |
| 105 | |
| 106 | func (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 | } |
no test coverage detected