File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,14 +292,16 @@ func GetSubstrate() (substrate.Manager, error) {
292292 if ! slices .Equal (subURLs , env .SubstrateURL ) {
293293 // before attempting to update the manager check if pool variable maintain a healthy connection
294294 // pool.Row() checks the health of the connection and if all the urls used in pool are down, then it will return error
295- cl , _ , err := pool .Raw ()
296- // if the old manager is broken, then we should update the manager
297- if err != nil {
295+ if pool != nil {
296+ cl , _ , err := pool .Raw ()
297+ if err == nil {
298+ cl .Client .Close ()
299+ return pool , nil
300+ }
298301 log .Debug ().Strs ("substrate_urls" , env .SubstrateURL ).Msg ("updating to sub manager with url" )
299- subURLs = env .SubstrateURL
300- pool = substrate .NewManager (env .SubstrateURL ... )
301302 }
302- cl .Client .Close ()
303+ subURLs = env .SubstrateURL
304+ pool = substrate .NewManager (env .SubstrateURL ... )
303305 }
304306
305307 // poolOnce.Do(func() {
You can’t perform that action at this time.
0 commit comments