diff --git a/config/worker_config.go b/config/worker_config.go index b51127b..fc59879 100644 --- a/config/worker_config.go +++ b/config/worker_config.go @@ -127,9 +127,9 @@ func WithTaskBodySizeMax(taskBodySizeMax int32) Option { } } -func WithActorSystemPort(port int32) Option { +func WithGrpcPort(port int32) Option { return func(config *WorkerConfig) { - config.actorSystemPort = port + config.grpcPort = port } } @@ -158,7 +158,7 @@ type WorkerConfig struct { workerParallelTaskMaxSize int32 workerMapPageSize int32 taskBodySizeMax int32 - actorSystemPort int32 + grpcPort int32 } func (w *WorkerConfig) IsShareContainerPool() bool { @@ -217,8 +217,8 @@ func (w *WorkerConfig) TaskBodySizeMax() int32 { return w.taskBodySizeMax } -func (w *WorkerConfig) ActorSystemPort() int32 { - return w.actorSystemPort +func (w *WorkerConfig) GrpcPort() int32 { + return w.grpcPort } func defaultWorkerConfig() *WorkerConfig { diff --git a/internal/actor/init.go b/internal/actor/init.go index 5b71c39..0469ce4 100644 --- a/internal/actor/init.go +++ b/internal/actor/init.go @@ -89,8 +89,8 @@ func InitActors(actorSystem *actor.ActorSystem) error { host = "0.0.0.0" port = 0 // random port ) - if actorSystemPort := config.GetWorkerConfig().ActorSystemPort(); actorSystemPort != 0 { - port = int(actorSystemPort) + if grpcPort := config.GetWorkerConfig().GrpcPort(); grpcPort != 0 { + port = int(grpcPort) } localHost, err := utils.GetIpv4AddrHost()