Skip to content

Commit

Permalink
Make sure we don't use the retry policy when no option is set, retain…
Browse files Browse the repository at this point in the history
…ing the same behavior as before.
  • Loading branch information
slinkydeveloper committed Oct 21, 2024
1 parent bdad3e1 commit e798246
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/restate-sdk/src/context_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,17 @@ export class ContextImpl implements ObjectContext, WorkflowContext {
message: err.message,
});
} else {
if (
options?.retryIntervalFactor === undefined &&
options?.initialRetryIntervalMillis === undefined &&
options?.maxRetryAttempts === undefined &&
options?.maxRetryDurationMillis === undefined &&
options?.maxRetryIntervalMillis === undefined
) {
// If no retry option was set, simply throw the error.
// This will lead to the invoker applying its retry, without the SDK overriding it.
throw err;
}
handle = this.coreVm.sys_run_exit_failure_transient(
err.message,
err.cause?.toString(),
Expand Down

0 comments on commit e798246

Please sign in to comment.