Skip to content

Commit

Permalink
Use a pointer for cancel func
Browse files Browse the repository at this point in the history
  • Loading branch information
pouya-eghbali committed Jan 13, 2025
1 parent 358e50d commit 9c4ba2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/rpc/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Task struct {
}

type TimeoutManager struct {
CancelFunc context.CancelFunc
CancelFunc *context.CancelFunc
Mutex *sync.Mutex
}

Expand Down Expand Up @@ -206,7 +206,7 @@ func (r *Coordinator) StartTimeoutManager() {
mu := &sync.Mutex{}

r.TimeoutManager = &TimeoutManager{
CancelFunc: cancel,
CancelFunc: &cancel,
Mutex: mu,
}

Expand Down

0 comments on commit 9c4ba2d

Please sign in to comment.