mirror of
https://github.com/kopia/kopia.git
synced 2026-01-20 20:37:54 -05:00
Unlike regular cache, which caches segments of blobs on a per-content basis, metadata cache will fetch and store the entire metadata blob (q) when any of the contents in it is accessed. Given that there are relatively few metadata blobs compared to data (p) blobs, this will reduce the traffic to the underlying store and improve performance of Snapshot GC which only relies on metadata contents.
20 lines
398 B
Go
20 lines
398 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/kopia/kopia/repo"
|
|
)
|
|
|
|
var (
|
|
cacheSyncCommand = cacheCommands.Command("sync", "Synchronizes the metadata cache with blobs in storage")
|
|
)
|
|
|
|
func runCacheSyncCommand(ctx context.Context, rep *repo.DirectRepository) error {
|
|
return rep.Content.SyncMetadataCache(ctx)
|
|
}
|
|
|
|
func init() {
|
|
cacheSyncCommand.Action(directRepositoryAction(runCacheSyncCommand))
|
|
}
|