Skip to content

Commit 5616864

Browse files
committed
Use worker.WorkerDeploymentVersion struct instead of string concatenation
Replace string concatenation for the Version field with the proper worker.WorkerDeploymentVersion struct that has separate DeploymentName and BuildId fields. This follows the Temporal SDK's expected API. Addresses: #130 (comment)
1 parent b2c6260 commit 5616864

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

go.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ toolchain go1.24.6
44

55
use (
66
.
7+
./internal/demo
78
./internal/tests
89
)

internal/demo/util/worker.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ func NewVersionedWorker(opts worker.Options) (w worker.Worker, stopFunc func())
3232
}()
3333

3434
opts.DeploymentOptions = worker.DeploymentOptions{
35-
UseVersioning: true,
36-
Version: mustGetEnv("TEMPORAL_DEPLOYMENT_NAME") + VersionIDSeparator + mustGetEnv("TEMPORAL_WORKER_BUILD_ID"),
35+
UseVersioning: true,
36+
Version: worker.WorkerDeploymentVersion{
37+
DeploymentName: mustGetEnv("TEMPORAL_DEPLOYMENT_NAME"),
38+
BuildId: mustGetEnv("TEMPORAL_WORKER_BUILD_ID"),
39+
},
3740
DefaultVersioningBehavior: workflow.VersioningBehaviorPinned,
3841
}
3942

0 commit comments

Comments
 (0)