open badger from source dirs as readonly

This commit is contained in:
whyrusleeping 2019-12-08 22:24:41 +01:00
parent c8cef8d92f
commit ba55aa117f

View File

@ -244,7 +244,9 @@ var aggregateSectorDirsCmd = &cli.Command{
}
}
mds, err := badger.NewDatastore(filepath.Join(dir, "badger"), nil)
opts := badger.DefaultOptions
opts.ReadOnly = true
mds, err := badger.NewDatastore(filepath.Join(dir, "badger"), &opts)
if err != nil {
return err
}