Skip to content

Commit 3243ebf

Browse files
committed
Avoid unnecessary logging in workflow timer
1 parent 9933720 commit 3243ebf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/workflow/timer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"sync"
55
"time"
66

7+
"go.uber.org/cadence"
78
"go.uber.org/cadence/workflow"
89
"go.uber.org/zap"
910
)
@@ -23,7 +24,9 @@ func (t *Timer) WithTimeout(ctx workflow.Context, d time.Duration) (workflow.Con
2324
timedCtx, cancelHandler := workflow.WithCancel(ctx)
2425
workflow.Go(ctx, func(ctx workflow.Context) {
2526
if err := workflow.NewTimer(ctx, d).Get(ctx, nil); err != nil {
26-
logger.Warn("Timer failed", zap.Error(err))
27+
if !cadence.IsCanceledError(err) {
28+
logger.Warn("Timer failed", zap.Error(err))
29+
}
2730
}
2831

2932
cancelHandler()

0 commit comments

Comments
 (0)