Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main/java/io/temporal/activity/Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,12 @@ public static ActivityExecutionContext getExecutionContext() {
* try {
* return someCall();
* } catch (Exception e) {
* throw CheckedExceptionWrapper.throwWrapped(e);
* throw Activity.wrap(e);
* }
* </pre>
*
* If throwWrapped returned void it wouldn't be possible to write <code>
* throw CheckedExceptionWrapper.throwWrapped</code> and compiler would complain about missing
* return.
* If wrap returned void it wouldn't be possible to write <code>
* throw Activity.wrap</code> and compiler would complain about missing return.
*
* @return never returns as always throws.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ private static <R> Promise<R> retryAsync(

private static RetryOptions getRetryOptionsSideEffect(String retryId, RetryOptions options) {
options = RetryOptions.newBuilder(options).validateBuildWithDefaults();
long maximumIntervalMillis =
options.getMaximumInterval() != null ? options.getMaximumInterval().toMillis() : 0;
long initialIntervalMillis =
options.getInitialInterval() != null ? options.getInitialInterval().toMillis() : 0;
SerializableRetryOptions sOptions =
new SerializableRetryOptions(
options.getInitialInterval().toMillis(),
initialIntervalMillis,
options.getBackoffCoefficient(),
options.getMaximumAttempts(),
options.getMaximumInterval().toMillis(),
maximumIntervalMillis,
options.getDoNotRetry());
SerializableRetryOptions sRetryOptions =
WorkflowInternal.mutableSideEffect(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/temporal/workflow/Workflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public static void retry(
* try {
* return someCall();
* } catch (Exception e) {
* throw CheckedExceptionWrapper.wrap(e);
* throw Workflow.wrap(e);
* }
* </pre>
*
Expand Down
7 changes: 1 addition & 6 deletions src/test/java/io/temporal/workflow/WorkflowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,7 @@ public String execute(String taskList) {
.setMaximumAttempts(3)
.build();
} else {
retryOptions =
RetryOptions.newBuilder()
.setMaximumInterval(Duration.ofSeconds(1))
.setInitialInterval(Duration.ofSeconds(1))
.setMaximumAttempts(2)
.build();
retryOptions = RetryOptions.newBuilder().setMaximumAttempts(2).build();
}
TestActivities activities = Workflow.newActivityStub(TestActivities.class, options.build());
Workflow.retry(retryOptions, Optional.of(Duration.ofDays(1)), () -> activities.throwIO());
Expand Down