lib/ur: Send unreported failures on shutdown (#7164)
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/protocol"
|
||||
"github.com/syncthing/syncthing/lib/rand"
|
||||
"github.com/syncthing/syncthing/lib/sha256"
|
||||
"github.com/syncthing/syncthing/lib/svcutil"
|
||||
"github.com/syncthing/syncthing/lib/sync"
|
||||
"github.com/syncthing/syncthing/lib/util"
|
||||
"github.com/thejerf/suture/v4"
|
||||
@@ -73,7 +74,7 @@ type Lowlevel struct {
|
||||
|
||||
func NewLowlevel(backend backend.Backend, evLogger events.Logger, opts ...Option) (*Lowlevel, error) {
|
||||
// Only log restarts in debug mode.
|
||||
spec := util.SpecWithDebugLogger(l)
|
||||
spec := svcutil.SpecWithDebugLogger(l)
|
||||
db := &Lowlevel{
|
||||
Supervisor: suture.New("db.Lowlevel", spec),
|
||||
Backend: backend,
|
||||
@@ -89,7 +90,7 @@ func NewLowlevel(backend backend.Backend, evLogger events.Logger, opts ...Option
|
||||
opt(db)
|
||||
}
|
||||
db.keyer = newDefaultKeyer(db.folderIdx, db.deviceIdx)
|
||||
db.Add(util.AsService(db.gcRunner, "db.Lowlevel/gcRunner"))
|
||||
db.Add(svcutil.AsService(db.gcRunner, "db.Lowlevel/gcRunner"))
|
||||
if path := db.needsRepairPath(); path != "" {
|
||||
if _, err := os.Lstat(path); err == nil {
|
||||
l.Infoln("Database was marked for repair - this may take a while")
|
||||
|
||||
Reference in New Issue
Block a user