all: sync with master
This commit is contained in:
@@ -384,7 +384,13 @@ func (s *StatsCtx) openDB() (err error) {
|
||||
s.logger.Debug("opening database")
|
||||
|
||||
var db *bbolt.DB
|
||||
db, err = bbolt.Open(s.filename, aghos.DefaultPermFile, nil)
|
||||
|
||||
opts := *bbolt.DefaultOptions
|
||||
// Use the custom OpenFile function to properly handle access rights on
|
||||
// Windows.
|
||||
opts.OpenFile = aghos.OpenFile
|
||||
|
||||
db, err = bbolt.Open(s.filename, aghos.DefaultPermFile, &opts)
|
||||
if err != nil {
|
||||
if err.Error() == "invalid argument" {
|
||||
const lines = `AdGuard Home cannot be initialized due to an incompatible file system.
|
||||
@@ -467,7 +473,7 @@ func (s *StatsCtx) flushDB(id, limit uint32, ptr *unit) (cont bool, sleepFor tim
|
||||
if delErr != nil {
|
||||
// TODO(e.burkov): Improve the algorithm of deleting the oldest bucket
|
||||
// to avoid the error.
|
||||
lvl := slog.LevelWarn
|
||||
lvl := slog.LevelDebug
|
||||
if !errors.Is(delErr, bbolt.ErrBucketNotFound) {
|
||||
isCommitable = false
|
||||
lvl = slog.LevelError
|
||||
|
||||
Reference in New Issue
Block a user