File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -303,12 +303,11 @@ func (d *Service) Run() (err error) {
303303 return
304304 }
305305
306- if err = d .G ().LocalDb .ForceOpen (); err != nil {
307- return err
308- }
309- if err = d .G ().LocalChatDb .ForceOpen (); err != nil {
310- return err
311- }
306+ // Open both local DBs concurrently. They are at different paths so there
307+ // is no lock contention between them. Any DB call that arrives before an
308+ // open finishes will block on sync.Once inside doWhileOpenAndNukeIfCorrupted.
309+ go func () { _ = d .G ().LocalDb .ForceOpen () }()
310+ go func () { _ = d .G ().LocalChatDb .ForceOpen () }()
312311
313312 var l net.Listener
314313 if l , err = d .ConfigRPCServer (); err != nil {
@@ -667,6 +666,12 @@ func (d *Service) StartLoopbackServer(loginMode libkb.LoginAttempt) error {
667666 return err
668667 }
669668
669+ // Open both local DBs concurrently. They are at different paths so there
670+ // is no lock contention between them. Any DB call that arrives before an
671+ // open finishes will block on sync.Once inside doWhileOpenAndNukeIfCorrupted.
672+ go func () { _ = d .G ().LocalDb .ForceOpen () }()
673+ go func () { _ = d .G ().LocalChatDb .ForceOpen () }()
674+
670675 if l , err = d .G ().MakeLoopbackServer (); err != nil {
671676 return err
672677 }
You can’t perform that action at this time.
0 commit comments