Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions go/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,11 @@ func (d *Service) Run() (err error) {
return
}

if err = d.G().LocalDb.ForceOpen(); err != nil {
return err
}
if err = d.G().LocalChatDb.ForceOpen(); err != nil {
return err
}
// Open both local DBs concurrently. They are at different paths so there
// is no lock contention between them. Any DB call that arrives before an
// open finishes will block on sync.Once inside doWhileOpenAndNukeIfCorrupted.
go func() { _ = d.G().LocalDb.ForceOpen() }()
go func() { _ = d.G().LocalChatDb.ForceOpen() }()

var l net.Listener
if l, err = d.ConfigRPCServer(); err != nil {
Expand Down Expand Up @@ -667,6 +666,12 @@ func (d *Service) StartLoopbackServer(loginMode libkb.LoginAttempt) error {
return err
}

// Open both local DBs concurrently. They are at different paths so there
// is no lock contention between them. Any DB call that arrives before an
// open finishes will block on sync.Once inside doWhileOpenAndNukeIfCorrupted.
go func() { _ = d.G().LocalDb.ForceOpen() }()
go func() { _ = d.G().LocalChatDb.ForceOpen() }()

if l, err = d.G().MakeLoopbackServer(); err != nil {
return err
}
Expand Down