File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -651,10 +651,14 @@ func (g *GlobalContext) configureDiskCachesLocked() error {
651651 g .LocalDb = NewJSONLocalDb (NewLevelDb (g , g .Env .GetDbFilename ))
652652 g .LocalChatDb = NewJSONLocalDb (NewLevelDb (g , g .Env .GetChatDbFilename ))
653653
654- epick := FirstErrorPicker {}
655- epick .Push (g .LocalDb .Open ())
656- epick .Push (g .LocalChatDb .Open ())
657- return epick .Error ()
654+ // Pre-warm both DBs concurrently. Open() is a no-op (lazy open via
655+ // sync.Once), so kick off ForceOpen in goroutines instead. Any
656+ // subsequent DB operation will block on sync.Once until its open
657+ // completes — no further synchronization needed here.
658+ go func () { _ = g .LocalDb .ForceOpen () }()
659+ go func () { _ = g .LocalChatDb .ForceOpen () }()
660+
661+ return nil
658662}
659663
660664func (g * GlobalContext ) ConfigureMerkleClient () error {
Original file line number Diff line number Diff line change @@ -303,13 +303,6 @@ 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- }
312-
313306 var l net.Listener
314307 if l , err = d .ConfigRPCServer (); err != nil {
315308 return err
You can’t perform that action at this time.
0 commit comments