298
// scanner shuts down. workflowType may be either a registered type-name string or the
299
// workflow function itself (registered under its Go function name).
300
>
func (s *Scanner) startWorkflowWithRetry(ctx context.Context, options sdkclient.StartWorkflowOptions, workflowType string, workflowArgs ...any) {
scanner.go
301
>
defer s.wg.Done()
302
>
303
>
policy := backoff.NewExponentialRetryPolicy(time.Second).
304
>
WithMaximumInterval(time.Minute).
305
>
WithExpirationInterval(backoff.NoInterval)
306
>
err := backoff.ThrottleRetryContext(ctx, func(ctx context.Context) error {
307
>
return s.startWorkflow(
308
>
ctx,
309
>
s.context.sdkClientFactory.GetSystemClient(),
310
>
options,
311
>
workflowType,
312
>
workflowArgs...,
313
>
)
314
>
}, policy, func(err error) bool {
315
return true
316
})
317
// if the scanner shuts down before the workflow is started, then the error will be context canceled
318
>
if err != nil && !common.IsContextCanceledErr(err) {
scanner.go
319
s.context.logger.Fatal("unable to start scanner", tag.WorkflowType(workflowType), tag.Error(err))
320
}