Skip to content

Commit 1aeb11a

Browse files
committed
add conditional branch for explicit cancellation log
1 parent 600a776 commit 1aeb11a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/worker/src/activity.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,14 @@ export class Activity {
149149
(error instanceof CancelledFailure || isAbortError(error)) &&
150150
this.context.cancellationSignal.aborted
151151
) {
152-
if (this.context.cancellationDetails?.reset) {
152+
if (this.context.cancellationDetails?.cancelRequested) {
153+
this.workerLogger.debug('Activity completed as cancelled', { durationMs });
154+
} else if (this.context.cancellationDetails?.reset) {
153155
this.workerLogger.debug('Activity reset', { durationMs });
154156
} else if (this.context.cancellationDetails?.paused) {
155157
this.workerLogger.debug('Activity paused', { durationMs });
156158
} else {
159+
// Fallback log - completed as cancelled.
157160
this.workerLogger.debug('Activity completed as cancelled', { durationMs });
158161
}
159162
} else if (error instanceof CompleteAsyncError) {

0 commit comments

Comments
 (0)