From ea701a4e9ed1aa3cd2662a102f2f9a87ab81232a Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 17 Mar 2021 22:52:43 +0100 Subject: [PATCH] cmd/syncthing: Error handling on upgrade (#7497) dat innocuous little colon --- cmd/syncthing/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 0da11245b..645099ab7 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -38,6 +38,7 @@ import ( "github.com/syncthing/syncthing/lib/build" "github.com/syncthing/syncthing/lib/config" "github.com/syncthing/syncthing/lib/db" + "github.com/syncthing/syncthing/lib/db/backend" "github.com/syncthing/syncthing/lib/dialer" "github.com/syncthing/syncthing/lib/events" "github.com/syncthing/syncthing/lib/fs" @@ -392,7 +393,8 @@ func (options serveOptions) Run() error { release, err := checkUpgrade() if err == nil { // Use leveldb database locks to protect against concurrent upgrades - ldb, err := syncthing.OpenDBBackend(locations.Get(locations.Database), config.TuningAuto) + var ldb backend.Backend + ldb, err = syncthing.OpenDBBackend(locations.Get(locations.Database), config.TuningAuto) if err != nil { err = upgradeViaRest() } else {