Skip to content

Commit 7c0a4b7

Browse files
committed
Fix: Update
1 parent dc043ca commit 7c0a4b7

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

cmd/dbos/migrate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ func runMigrate(cmd *cobra.Command, args []string) error {
3333
return err
3434
}
3535

36+
ctx := context.Background()
37+
3638
// Create DBOS context which will run migrations automatically for the system DB
37-
_, err = createDBOSContext(dbURL)
39+
_, err = createDBOSContext(dbURL, ctx)
3840
if err != nil {
3941
return fmt.Errorf("failed to create DBOS context: %w", err)
4042
}

cmd/dbos/workflow.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
56
"time"
67

@@ -89,8 +90,10 @@ func runWorkflowList(cmd *cobra.Command, args []string) error {
8990
return err
9091
}
9192

93+
user_ctx := context.Background()
94+
9295
// Create DBOS context
93-
ctx, err := createDBOSContext(dbURL)
96+
ctx, err := createDBOSContext(dbURL, user_ctx)
9497
if err != nil {
9598
return err
9699
}
@@ -194,8 +197,10 @@ func runWorkflowGet(cmd *cobra.Command, args []string) error {
194197
return err
195198
}
196199

200+
user_ctx := context.Background()
201+
197202
// Create DBOS context
198-
ctx, err := createDBOSContext(dbURL)
203+
ctx, err := createDBOSContext(dbURL, user_ctx)
199204
if err != nil {
200205
return err
201206
}
@@ -227,8 +232,10 @@ func runWorkflowSteps(cmd *cobra.Command, args []string) error {
227232
return err
228233
}
229234

235+
user_ctx := context.Background()
236+
230237
// Create DBOS context
231-
ctx, err := createDBOSContext(dbURL)
238+
ctx, err := createDBOSContext(dbURL, user_ctx)
232239
if err != nil {
233240
return err
234241
}
@@ -257,8 +264,10 @@ func runWorkflowCancel(cmd *cobra.Command, args []string) error {
257264
return err
258265
}
259266

267+
user_ctx := context.Background()
268+
260269
// Create DBOS context
261-
ctx, err := createDBOSContext(dbURL)
270+
ctx, err := createDBOSContext(dbURL, user_ctx)
262271
if err != nil {
263272
return err
264273
}
@@ -281,8 +290,10 @@ func runWorkflowResume(cmd *cobra.Command, args []string) error {
281290
return err
282291
}
283292

293+
user_ctx := context.Background()
294+
284295
// Create DBOS context
285-
ctx, err := createDBOSContext(dbURL)
296+
ctx, err := createDBOSContext(dbURL, user_ctx)
286297
if err != nil {
287298
return err
288299
}
@@ -312,8 +323,10 @@ func runWorkflowFork(cmd *cobra.Command, args []string) error {
312323
return err
313324
}
314325

326+
user_ctx := context.Background()
327+
315328
// Create DBOS context
316-
ctx, err := createDBOSContext(dbURL)
329+
ctx, err := createDBOSContext(dbURL, user_ctx)
317330
if err != nil {
318331
return err
319332
}

0 commit comments

Comments
 (0)