Use a smaller badger log file size to be compatible with 32 bit systems (#108)
This commit is contained in:
parent
64a12d1780
commit
1a59d03a0c
2 changed files with 12 additions and 2 deletions
|
@ -19,7 +19,12 @@ type DB struct {
|
||||||
|
|
||||||
func NewDB(path string) (*DB, error) {
|
func NewDB(path string) (*DB, error) {
|
||||||
l := log.Logger.With().Str("component", "torrent-store").Logger()
|
l := log.Logger.With().Str("component", "torrent-store").Logger()
|
||||||
db, err := badger.Open(badger.DefaultOptions(path).WithLogger(&dlog.Badger{L: l}))
|
|
||||||
|
opts := badger.DefaultOptions(path).
|
||||||
|
WithLogger(&dlog.Badger{L: l}).
|
||||||
|
WithValueLogFileSize(1<<26 - 1)
|
||||||
|
|
||||||
|
db, err := badger.Open(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,12 @@ type FileItemStore struct {
|
||||||
|
|
||||||
func NewFileItemStore(path string, itemsTTL time.Duration) (*FileItemStore, error) {
|
func NewFileItemStore(path string, itemsTTL time.Duration) (*FileItemStore, error) {
|
||||||
l := log.Logger.With().Str("component", "item-store").Logger()
|
l := log.Logger.With().Str("component", "item-store").Logger()
|
||||||
db, err := badger.Open(badger.DefaultOptions(path).WithLogger(&dlog.Badger{L: l}))
|
|
||||||
|
opts := badger.DefaultOptions(path).
|
||||||
|
WithLogger(&dlog.Badger{L: l}).
|
||||||
|
WithValueLogFileSize(1<<26 - 1)
|
||||||
|
|
||||||
|
db, err := badger.Open(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue