Skip to content

Commit 93d2af8

Browse files
committed
feat: Refactor taskType to use RetryTaskType in RetryHandlerTask and RetryableTask
1 parent 157f357 commit 93d2af8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/durabletask-js/src/task/retry-handler-task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33

44
import * as pb from "../proto/orchestrator_service_pb";
5-
import { RetryTaskBase } from "./retry-task-base";
5+
import { RetryTaskBase, RetryTaskType } from "./retry-task-base";
66
import { AsyncRetryHandler } from "./retry/retry-handler";
77
import { createRetryContext } from "./retry/retry-context";
88
import { TaskFailureDetails } from "./failure-details";
@@ -34,7 +34,7 @@ export class RetryHandlerTask<T> extends RetryTaskBase<T> {
3434
handler: AsyncRetryHandler,
3535
action: pb.OrchestratorAction,
3636
startTime: Date,
37-
taskType: "activity" | "subOrchestration",
37+
taskType: RetryTaskType,
3838
) {
3939
super(action, startTime, taskType);
4040
this._handler = handler;

packages/durabletask-js/src/task/retryable-task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import { RetryTaskBase } from "./retry-task-base";
4+
import { RetryTaskBase, RetryTaskType } from "./retry-task-base";
55
import { RetryPolicy } from "./retry/retry-policy";
66
import * as pb from "../proto/orchestrator_service_pb";
77

@@ -28,7 +28,7 @@ export class RetryableTask<T> extends RetryTaskBase<T> {
2828
retryPolicy: RetryPolicy,
2929
action: pb.OrchestratorAction,
3030
startTime: Date,
31-
taskType: "activity" | "subOrchestration",
31+
taskType: RetryTaskType,
3232
) {
3333
super(action, startTime, taskType);
3434
this._retryPolicy = retryPolicy;

packages/durabletask-js/src/worker/runtime-orchestration-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ParentOrchestrationInstance } from "../types/parent-orchestration-insta
88
import * as pb from "../proto/orchestrator_service_pb";
99
import * as ph from "../utils/pb-helper.util";
1010
import { CompletableTask } from "../task/completable-task";
11-
import { RetryTaskBase } from "../task/retry-task-base";
11+
import { RetryTaskBase, RetryTaskType } from "../task/retry-task-base";
1212
import { RetryableTask } from "../task/retryable-task";
1313
import { RetryHandlerTask } from "../task/retry-handler-task";
1414
import { RetryTimerTask } from "../task/retry-timer-task";
@@ -518,7 +518,7 @@ export class RuntimeOrchestrationContext extends OrchestrationContext {
518518
action: pb.OrchestratorAction,
519519
id: number,
520520
options: TaskOptions | SubOrchestrationOptions | undefined,
521-
taskType: "activity" | "subOrchestration",
521+
taskType: RetryTaskType
522522
): CompletableTask<TOutput> {
523523
if (options?.retry && isRetryPolicy(options.retry)) {
524524
const retryableTask = new RetryableTask<TOutput>(

0 commit comments

Comments
 (0)