Skip to content

Commit

Permalink
fix(deps): bump go.temporal.io/sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallesm committed Feb 24, 2025
1 parent f0c1ada commit a3d894b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 493 deletions.
18 changes: 9 additions & 9 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"go.temporal.io/api/workflowservice/v1"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/worker"

"github.com/instill-ai/x/temporal"
"github.com/instill-ai/x/zapadapter"
"google.golang.org/protobuf/types/known/durationpb"

"github.com/instill-ai/mgmt-backend/config"
"github.com/instill-ai/mgmt-backend/pkg/logger"
"github.com/instill-ai/x/temporal"
"github.com/instill-ai/x/zapadapter"

custom_otel "github.com/instill-ai/mgmt-backend/pkg/logger/otel"
mgmtWorker "github.com/instill-ai/mgmt-backend/pkg/worker"
customotel "github.com/instill-ai/mgmt-backend/pkg/logger/otel"
mgmtworker "github.com/instill-ai/mgmt-backend/pkg/worker"
)

func initTemporalNamespace(ctx context.Context, client client.Client) {
Expand All @@ -42,7 +42,7 @@ func initTemporalNamespace(ctx context.Context, client client.Client) {
if _, err := client.WorkflowService().RegisterNamespace(ctx,
&workflowservice.RegisterNamespaceRequest{
Namespace: config.Config.Temporal.Namespace,
WorkflowExecutionRetentionPeriod: func() *time.Duration {
WorkflowExecutionRetentionPeriod: func() *durationpb.Duration {
// Check if the string ends with "d" for day.
s := config.Config.Temporal.Retention
if strings.HasSuffix(s, "d") {
Expand All @@ -53,7 +53,7 @@ func initTemporalNamespace(ctx context.Context, client client.Client) {
}
// Convert days to hours and then to a duration.
t := time.Hour * 24 * time.Duration(days)
return &t
return durationpb.New(t)
}
logger.Fatal(fmt.Sprintf("Unable to parse retention period in day: %s", err))
return nil
Expand All @@ -74,7 +74,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())

// setup tracing and metrics
if tp, err := custom_otel.SetupTracing(ctx, "mgmt-backend-worker"); err != nil {
if tp, err := customotel.SetupTracing(ctx, "mgmt-backend-worker"); err != nil {
panic(err)
} else {
defer func() {
Expand Down Expand Up @@ -129,7 +129,7 @@ func main() {
initTemporalNamespace(ctx, temporalClient)
}

w := worker.New(temporalClient, mgmtWorker.TaskQueue, worker.Options{
w := worker.New(temporalClient, mgmtworker.TaskQueue, worker.Options{
MaxConcurrentActivityExecutionSize: 2,
})

Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gogo/status v1.1.1
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
github.com/iancoleman/strcase v0.2.0
github.com/influxdata/influxdb-client-go/v2 v2.12.3
Expand All @@ -34,7 +34,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
go.temporal.io/api v1.44.1
go.temporal.io/sdk v1.21.0
go.temporal.io/sdk v1.32.1
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.31.0
golang.org/x/image v0.18.0
Expand Down Expand Up @@ -89,20 +89,22 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/nexus-rpc/sdk-go v0.1.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/stretchr/testify v1.10.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
Expand Down
Loading

0 comments on commit a3d894b

Please sign in to comment.