mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
feat(startup): update logic for metadb update on startup, skip unmodified repos (#2024)
- MetaDB stores the time of the last update of a repo - During startup we check if the layout has been updated after the last recorded change in the db - If this is the case, the repo is parsed and updated in the DB otherwise it's skipped Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -264,22 +264,22 @@ func TestCreateMetaDBDriver(t *testing.T) {
|
||||
|
||||
const perms = 0o600
|
||||
|
||||
boltDB, err := bbolt.Open(path.Join(dir, "repo.db"), perms, &bbolt.Options{Timeout: time.Second * 10})
|
||||
boltDB, err := bbolt.Open(path.Join(dir, "meta.db"), perms, &bbolt.Options{Timeout: time.Second * 10})
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = boltDB.Close()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = os.Chmod(path.Join(dir, "repo.db"), 0o200)
|
||||
err = os.Chmod(path.Join(dir, "meta.db"), 0o200)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
_, err = meta.New(conf.Storage.StorageConfig, log)
|
||||
So(err, ShouldNotBeNil)
|
||||
|
||||
err = os.Chmod(path.Join(dir, "repo.db"), 0o600)
|
||||
err = os.Chmod(path.Join(dir, "meta.db"), 0o600)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
defer os.Remove(path.Join(dir, "repo.db"))
|
||||
defer os.Remove(path.Join(dir, "meta.db"))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user