mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(loadrepodb): statistics are now preserved after reloading zot (#1289)
- before, the download count for a manifest and repo star count were lost after reload - now we are keeping these values when we reset the repo-meta structure Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -25,6 +25,8 @@ type RepoDBMock struct {
|
||||
|
||||
GetRepoMetaFn func(repo string) (repodb.RepoMetadata, error)
|
||||
|
||||
SetRepoMetaFn func(repo string, repoMeta repodb.RepoMetadata) error
|
||||
|
||||
GetMultipleRepoMetaFn func(ctx context.Context, filter func(repoMeta repodb.RepoMetadata) bool,
|
||||
requestedPage repodb.PageInput) ([]repodb.RepoMetadata, error)
|
||||
|
||||
@@ -142,6 +144,14 @@ func (sdm RepoDBMock) GetRepoMeta(repo string) (repodb.RepoMetadata, error) {
|
||||
return repodb.RepoMetadata{}, nil
|
||||
}
|
||||
|
||||
func (sdm RepoDBMock) SetRepoMeta(repo string, repoMeta repodb.RepoMetadata) error {
|
||||
if sdm.SetRepoMetaFn != nil {
|
||||
return sdm.SetRepoMetaFn(repo, repoMeta)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sdm RepoDBMock) GetMultipleRepoMeta(ctx context.Context, filter func(repoMeta repodb.RepoMetadata) bool,
|
||||
requestedPage repodb.PageInput,
|
||||
) ([]repodb.RepoMetadata, error) {
|
||||
|
||||
Reference in New Issue
Block a user