Skip to content

Commit

Permalink
Get number of concurrent workflows from capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielCosme committed Jun 12, 2024
1 parent 1525362 commit 3ee0e7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func main() {
os.Exit(1)
}

numOfWorkflows := uint64(0)
for _, a := range config.Pipeline {
numOfWorkflows += a.Capacity

Check warning on line 91 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L89-L91

Added lines #L89 - L91 were not covered by tests
}

// Logging configuration.
logger := log.New(os.Stderr,
log.WithName(appName),
Expand Down Expand Up @@ -254,8 +259,8 @@ func main() {
done := make(chan struct{})
w := temporalsdk_worker.New(temporalClient, config.Temporal.TaskQueue, temporalsdk_worker.Options{
EnableSessionWorker: true,
MaxConcurrentSessionExecutionSize: config.Worker.MaxConcurrentSessionExecutionSize,
MaxConcurrentWorkflowTaskExecutionSize: config.Worker.MaxConcurrentWorkflowsExecutionsSize,
MaxConcurrentSessionExecutionSize: int(numOfWorkflows),
MaxConcurrentWorkflowTaskExecutionSize: int(numOfWorkflows),
MaxHeartbeatThrottleInterval: config.Worker.HeartbeatThrottleInterval,
DefaultHeartbeatThrottleInterval: config.Worker.HeartbeatThrottleInterval,

Check warning on line 265 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L261-L265

Added lines #L261 - L265 were not covered by tests
})
Expand Down

0 comments on commit 3ee0e7c

Please sign in to comment.