mirror of https://github.com/dapr/go-sdk.git
Prevent workflows client nilpointer (#583)
* bump durabletask dep Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com> * workflows client, prevent nilpointer error on convertMetadata Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com> --------- Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
This commit is contained in:
parent
dd35c21392
commit
c417f950fe
2
go.mod
2
go.mod
|
@ -7,7 +7,7 @@ require (
|
|||
github.com/go-chi/chi/v5 v5.0.12
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58
|
||||
github.com/stretchr/testify v1.8.4
|
||||
google.golang.org/grpc v1.62.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
|
|
4
go.sum
4
go.sum
|
@ -30,8 +30,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
|||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/marusama/semaphore/v2 v2.5.0 h1:o/1QJD9DBYOWRnDhPwDVAXQn6mQYD0gZaS1Tpx6DJGM=
|
||||
github.com/marusama/semaphore/v2 v2.5.0/go.mod h1:z9nMiNUekt/LTpTUQdpp+4sJeYqUGpwMHfW0Z8V8fnQ=
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d h1:CVjystOHucBzKExLHD8E96D4KUNbehP0ozgue/6Tq/Y=
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240122160106-fb5c4c05729d/go.mod h1:OSZ4K7SgqBEsaouk3lAVdDzvanIzsdj7angZ0FTeSAU=
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58 h1:+HZ6RzZz6YBfA+Chtn0SnMU2OgY6nafl2sGbZ9FmerY=
|
||||
github.com/microsoft/durabletask-go v0.4.1-0.20240621011625-bfcc3331ca58/go.mod h1:goe2gmMgLptCijMDQ7JsekaR86KjPUG64V9JDXvKBhE=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
|
|
|
@ -135,6 +135,9 @@ func (c *client) FetchWorkflowMetadata(ctx context.Context, id string, opts ...a
|
|||
return nil, errors.New("no workflow id specified")
|
||||
}
|
||||
wfMetadata, err := c.taskHubClient.FetchOrchestrationMetadata(ctx, api.InstanceID(id), opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return convertMetadata(wfMetadata), err
|
||||
}
|
||||
|
@ -145,6 +148,9 @@ func (c *client) WaitForWorkflowStart(ctx context.Context, id string, opts ...ap
|
|||
return nil, errors.New("no workflow id specified")
|
||||
}
|
||||
wfMetadata, err := c.taskHubClient.WaitForOrchestrationStart(ctx, api.InstanceID(id), opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return convertMetadata(wfMetadata), err
|
||||
}
|
||||
|
@ -155,6 +161,9 @@ func (c *client) WaitForWorkflowCompletion(ctx context.Context, id string, opts
|
|||
return nil, errors.New("no workflow id specified")
|
||||
}
|
||||
wfMetadata, err := c.taskHubClient.WaitForOrchestrationCompletion(ctx, api.InstanceID(id), opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return convertMetadata(wfMetadata), err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue