Skip to content

Commit

Permalink
fix shadow error
Browse files Browse the repository at this point in the history
  • Loading branch information
tuannh982 committed Dec 21, 2024
1 parent d7d03e0 commit 0588d37
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions pkg/backend/psql/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ func (b *be) GetWorkflowTask(ctx context.Context) (result *task.WorkflowTask, er
if err != nil {
tx.Rollback()
if t != nil {
err = b.taskRepo.TouchTask(ctx, t.WorkflowID, t.TaskID)
if err != nil {
b.logger.Error("failed to update workflow task", zap.Error(err))
tErr := b.taskRepo.TouchTask(ctx, t.WorkflowID, t.TaskID)
if tErr != nil {
b.logger.Error(
"failed to update workflow task",
zap.Error(tErr),
zap.String("workflow_id", t.WorkflowID),
)
}
}
} else {
Expand Down Expand Up @@ -482,9 +486,14 @@ func (b *be) GetActivityTask(ctx context.Context) (result *task.ActivityTask, er
if err != nil {
tx.Rollback()
if t != nil {
err = b.taskRepo.TouchTask(ctx, t.WorkflowID, t.TaskID)
if err != nil {
b.logger.Error("failed to update workflow task", zap.Error(err))
tErr := b.taskRepo.TouchTask(ctx, t.WorkflowID, t.TaskID)
if tErr != nil {
b.logger.Error(
"failed to update activity task",
zap.Error(tErr),
zap.String("workflow_id", t.WorkflowID),
zap.String("task_id", t.TaskID),
)
}
}
} else {
Expand Down

0 comments on commit 0588d37

Please sign in to comment.