Files
poimen-workflows/internal/temporal/context.go
rockandpoimen 76d8c518f0
CI / CI (push) Successful in 4m11s
(feat) Temporal SDK client, worker mgmt, k8s deployments (#10)
## Changes
- `internal/temporal/client.go` — Robust Temporal client with retry (exp backoff), TLS, health check
- `internal/temporal/worker.go` — Worker creation, activity/workflow registration, lifecycle
- `internal/temporal/context.go` — Timeout helpers
- `k8s/worker-deployment.yaml` — 2-10 replica HPA, liveness/readiness probes, security context, pod anti-affinity
- `k8s/workflow-runner-deployment.yaml` — Singleton runner with probes
- `k8s/kustomization.yaml` — Updated resource list

Co-authored-by: poimen <[email protected]>
2026-09-09 00:03:00 +00:00

17 lines
474 B
Go

package temporal
import (
"context"
"time"
)
// ContextWithTimeout creates a context with the given timeout.
func ContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc) {
return context.WithTimeout(context.Background(), timeout)
}
// ContextWithDefault creates a context with a default timeout of 10 seconds.
func ContextWithDefault() (context.Context, context.CancelFunc) {
return context.WithTimeout(context.Background(), 10*time.Second)
}