Skip to content

Commit 6eafe2b

Browse files
committed
must register R, because the client might be on another machine. Also we'll make the encoder part of the context eventually.
1 parent 82faad3 commit 6eafe2b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dbos/workflow.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,11 @@ func RetrieveWorkflow[R any](ctx DBOSContext, workflowID string) (workflowPollin
12381238
if ctx == nil {
12391239
return workflowPollingHandle[R]{}, errors.New("dbosCtx cannot be nil")
12401240
}
1241+
1242+
// Register the output for gob encoding
1243+
var r R
1244+
gob.Register(r)
1245+
12411246
workflowStatus, err := ctx.(*dbosContext).systemDB.listWorkflows(ctx, listWorkflowsDBInput{
12421247
workflowIDs: []string{workflowID},
12431248
})
@@ -1395,6 +1400,11 @@ func ResumeWorkflow[R any](ctx DBOSContext, workflowID string) (WorkflowHandle[R
13951400
if ctx == nil {
13961401
return nil, errors.New("ctx cannot be nil")
13971402
}
1403+
1404+
// Register the output for gob encoding
1405+
var r R
1406+
gob.Register(r)
1407+
13981408
_, err := ctx.ResumeWorkflow(ctx, workflowID)
13991409
if err != nil {
14001410
return nil, err
@@ -1526,6 +1536,10 @@ func ForkWorkflow[R any](ctx DBOSContext, originalWorkflowID string, opts ...For
15261536
return nil, errors.New("ctx cannot be nil")
15271537
}
15281538

1539+
// Register the output for gob encoding
1540+
var r R
1541+
gob.Register(r)
1542+
15291543
handle, err := ctx.ForkWorkflow(ctx, originalWorkflowID, opts...)
15301544
if err != nil {
15311545
return nil, err

0 commit comments

Comments
 (0)