File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -386,8 +386,20 @@ func newNodeOpts(token string) ([]node.Option, error) {
386386 // TODO: move this up, expose more config options when creating a node
387387 noDHT := os .Getenv ("LOCALAI_P2P_DISABLE_DHT" ) == "true"
388388 noLimits := os .Getenv ("LOCALAI_P2P_ENABLE_LIMITS" ) == "true"
389- listenMaddrs := strings .Split (os .Getenv ("LOCALAI_P2P_LISTEN_MADDRS" ), "," )
390- bootstrapPeers := strings .Split (os .Getenv ("LOCALAI_P2P_BOOTSTRAP_PEERS_MADDRS" ), "," )
389+
390+ var listenMaddrs []string
391+ var bootstrapPeers []string
392+
393+ laddrs := os .Getenv ("LOCALAI_P2P_LISTEN_MADDRS" )
394+ if laddrs != "" {
395+ listenMaddrs = strings .Split (laddrs , "," )
396+ }
397+
398+ bootmaddr := os .Getenv ("LOCALAI_P2P_BOOTSTRAP_PEERS_MADDRS" )
399+ if bootmaddr != "" {
400+ bootstrapPeers = strings .Split (bootmaddr , "," )
401+ }
402+
391403 dhtAnnounceMaddrs := stringsToMultiAddr (strings .Split (os .Getenv ("LOCALAI_P2P_DHT_ANNOUNCE_MADDRS" ), "," ))
392404
393405 libp2ploglevel := os .Getenv ("LOCALAI_P2P_LIB_LOGLEVEL" )
You can’t perform that action at this time.
0 commit comments