Skip to content

Commit

Permalink
feat: actorySystemPort change to grpcPort
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangXiaomeng committed Mar 22, 2024
1 parent 64fd0de commit b3637fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions config/worker_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -158,7 +158,7 @@ type WorkerConfig struct {
workerParallelTaskMaxSize int32
workerMapPageSize int32
taskBodySizeMax int32
actorSystemPort int32
grpcPort int32
}

func (w *WorkerConfig) IsShareContainerPool() bool {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions internal/actor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b3637fa

Please sign in to comment.