Skip to content

Commit c021274

Browse files
author
Evan Sandoval
committed
nil checks
1 parent 32a9340 commit c021274

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/activity.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,10 @@ func WithActivityTask(
356356
zapcore.Field{Key: tagWorkflowType, Type: zapcore.StringType, String: *task.WorkflowType.Name},
357357
zapcore.Field{Key: tagWorkflowID, Type: zapcore.StringType, String: *task.WorkflowExecution.WorkflowId},
358358
zapcore.Field{Key: tagRunID, Type: zapcore.StringType, String: *task.WorkflowExecution.RunId},
359-
zapcore.Field{Key: tagAttempt, Type: zapcore.Int32Type, Int32: *task.Attempt},
360359
)
360+
if task.Attempt != nil {
361+
logger = logger.With(zapcore.Field{Key: tagAttempt, Type: zapcore.Int64Type, Integer: int64(*task.Attempt)})
362+
}
361363

362364
return context.WithValue(ctx, activityEnvContextKey, &activityEnvironment{
363365
taskToken: task.TaskToken,

internal/internal_logging_tags.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
tagDomain = "Domain"
2727
tagEventID = "EventID"
2828
tagEventType = "EventType"
29+
tagAttempt = "Attempt"
2930
tagRunID = "RunID"
3031
tagTaskList = "TaskList"
3132
tagTimerID = "TimerID"

0 commit comments

Comments
 (0)