func (c *committedContentIndex) use(ctx context.Context, indexFiles []blob.ID, ignoreDeletedBefore time.Time) error {
	c.mu.Lock()
	defer c.mu.Unlock()

	c.deletionWatermark = ignoreDeletedBefore

	if !c.indexFilesChanged(indexFiles) {
		return nil
	}

	c.log.Debugf("use-indexes %v", indexFiles)

	mergedAndCombined, newInUse, err := c.merge(ctx, indexFiles)
	if err != nil {
		return err
	}

	atomic.AddInt64(&c.rev, 1)

	c.merged = mergedAndCombined
	c.inUse = newInUse

	if err := c.cache.expireUnused(ctx, indexFiles); err != nil {
		c.log.Errorf("unable to expire unused index files: %v", err)
	}

	return nil
}
// Uses indexFiles for indexing. An error is returned if the
// indices cannot be read for any reason.
Uses indexFiles for indexing. An error is returned if the
indices cannot be read for any reason.
// Uses indexFiles for indexing . An error is returned if the // indices cannot be read for any reason .
func (c *committedContentIndex) use(ctx context.Context, indexFiles []blob.ID, ignoreDeletedBefore time.Time) error {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.deletionWatermark = ignoreDeletedBefore
	if !c.indexFilesChanged(indexFiles) {
		return nil
	}
	c.log.Debugf("use-indexes %v", indexFiles)
	mergedAndCombined, newInUse, err := c.merge(ctx, indexFiles)
	if err != nil {
		return err
	}
	atomic.AddInt64(&c.rev, 1)
	c.merged = mergedAndCombined
	c.inUse = newInUse
	if err := c.cache.expireUnused(ctx, indexFiles); err != nil {
		c.log.Errorf("unable to expire unused index files: %v", err)
	}
	return nil
}
func ( c * committedContentIndex ) use ( ctx context . Context , indexFiles [ ] blob . ID , ignoreDeletedBefore time . Time ) error { c . mu . Lock ( ) defer c . mu . Unlock ( ) c . deletionWatermark = ignoreDeletedBefore if ! c . indexFilesChanged ( indexFiles ) { return nil } c . log . Debugf ( " " , indexFiles ) mergedAndCombined , newInUse , err := c . merge ( ctx , indexFiles ) if err != nil { return err } atomic . AddInt64 ( & c . rev , 1 ) c . merged = mergedAndCombined c . inUse = newInUse if err := c . cache . expireUnused ( ctx , indexFiles ) ; err != nil { c . log . Errorf ( " " , err ) } return nil }
Uses indexFiles for indexing.
Uses indexFiles for indexing .