Skip to content

Commit f6b36c3

Browse files
committed
add conditional branch for explicit cancellation log
1 parent 8516b76 commit f6b36c3

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
@@ -144,11 +144,14 @@ export class Activity {
144144
(error instanceof CancelledFailure || isAbortError(error)) &&
145145
this.context.cancellationSignal.aborted
146146
) {
147-
if (this.context.cancellationDetails?.reset) {
147+
if (this.context.cancellationDetails?.cancelRequested) {
148+
this.workerLogger.debug('Activity completed as cancelled', { durationMs });
149+
} else if (this.context.cancellationDetails?.reset) {
148150
this.workerLogger.debug('Activity reset', { durationMs });
149151
} else if (this.context.cancellationDetails?.paused) {
150152
this.workerLogger.debug('Activity paused', { durationMs });
151153
} else {
154+
// Fallback log - completed as cancelled.
152155
this.workerLogger.debug('Activity completed as cancelled', { durationMs });
153156
}
154157
} else if (error instanceof CompleteAsyncError) {

0 commit comments

Comments
 (0)