mirror of
https://github.com/luxfi/netrunner.git
synced 2026-07-27 00:04:23 +00:00
set static ports by default for server, with dynamic prots option
This commit is contained in:
@@ -123,6 +123,7 @@ func (c *client) Start(ctx context.Context, execPath string, opts ...OpOption) (
|
||||
req.CustomNodeConfigs = ret.customNodeConfigs
|
||||
}
|
||||
req.ReassignPortsIfUsed = &ret.reassignPortsIfUsed
|
||||
req.DynamicPorts = &ret.dynamicPorts
|
||||
|
||||
c.log.Info("start")
|
||||
return c.controlc.Start(ctx, req)
|
||||
@@ -340,6 +341,7 @@ type Op struct {
|
||||
chainConfigs map[string]string
|
||||
upgradeConfigs map[string]string
|
||||
reassignPortsIfUsed bool
|
||||
dynamicPorts bool
|
||||
}
|
||||
|
||||
type OpOption func(*Op)
|
||||
@@ -426,6 +428,12 @@ func WithReassignPortsIfUsed(reassignPortsIfUsed bool) OpOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithDynamicPorts(dynamicPorts bool) OpOption {
|
||||
return func(op *Op) {
|
||||
op.dynamicPorts = dynamicPorts
|
||||
}
|
||||
}
|
||||
|
||||
func isClientCanceled(ctxErr error, err error) bool {
|
||||
if ctxErr != nil {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user