Skip to content

Commit

Permalink
Merge pull request #216 from formancehq/feat/payments-v3-max-task-pol…
Browse files Browse the repository at this point in the history
…lers-settings

feat(payments): add settings for max workflow and activity task pollers
  • Loading branch information
paul-nicolas authored Jan 9, 2025
2 parents f60af76 + 1a2c75a commit e70a7aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/09-Configuration reference/01-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ While we have some basic types (string, number, bool ...), we also have some com
| ledger.experimental-features | Bool | true | Enable experimental features |
| ledger.experimental-numscript-interpreter | Bool | true | Enable new numscript interpreter |
| payments.encryption-key | string | | Payments data encryption key |
| payments.worker.temporal-max-concurrent-workflow-task-pollers | Int | | Payments worker max concurrent workflow task pollers configuration |
| payments.worker.temporal-max-concurrent-activity-task-pollers | Int | | Payments worker max concurrent activity task pollers configuration |
| deployments.`<deployment-name>`.init-containers.`<container-name>`.resource-requirements | Map | cpu=X, mem=X | |
| deployments.`<deployment-name>`.containers.`<container-name>`.resource-requirements | Map | cpu=X, mem=X | |
| deployments.`<deployment-name>`.init-containers.`<container-name>`.run-as | Map | user=X, group=X | |
| deployments.`<deployment-name>`.containers.`<container-name>`.run-as | Map | user=X, group=X | |
| deployments.`<deployment-name>`.replicas | string | 2 | |
| caddy.image | string | | Caddy image |
+ | jobs.`<owner-kind>`.init-containers.`<container-name>`.run-as | Map | user=X, group=X | Configure the security context for init containers in jobs by specifying the user and group IDs to run as |
| jobs.`<owner-kind>`.init-containers.`<container-name>`.run-as | Map | user=X, group=X | Configure the security context for init containers in jobs by specifying the user and group IDs to run as |
| jobs.`<owner-kind>`.containers.`<container-name>`.run-as | Map | user=X, group=X | Configure the security context for containers in jobs by specifying the user and group IDs to run as |
| registries.`<name>`.endpoint | string | | Specify a custom endpoint for a specific docker repository |
| registries.`<name>`.images.`<path>`.rewrite | string | formancehq/example | Allow to rewrite the image path |
Expand Down
15 changes: 15 additions & 0 deletions internal/resources/payments/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ func temporalEnvVars(ctx core.Context, stack *v1beta1.Stack, payments *v1beta1.P
)
}

temporalMaxConcurrentWorkflowTaskPollers, err := settings.GetIntOrDefault(ctx, stack.Name, 4, "payments", "worker", "temporal-max-concurrent-workflow-task-pollers")
if err != nil {
return nil, err
}

temporalMaxConcurrentActivityTaskPollers, err := settings.GetIntOrDefault(ctx, stack.Name, 4, "payments", "worker", "temporal-max-concurrent-activity-task-pollers")
if err != nil {
return nil, err
}

env = append(env,
core.Env("TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_POLLERS", fmt.Sprintf("%d", temporalMaxConcurrentWorkflowTaskPollers)),
core.Env("TEMPORAL_MAX_CONCURRENT_ACTIVITY_TASK_POLLERS", fmt.Sprintf("%d", temporalMaxConcurrentActivityTaskPollers)),
)

return env, nil
}

Expand Down

0 comments on commit e70a7aa

Please sign in to comment.