From 9c4ba2d3f0b698ab80f9bfc6bd0f697b60ae973c Mon Sep 17 00:00:00 2001 From: Pouya Date: Mon, 13 Jan 2025 22:24:33 +0100 Subject: [PATCH] Use a pointer for cancel func --- internal/service/rpc/coordinator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/rpc/coordinator.go b/internal/service/rpc/coordinator.go index 0f3b262..abf9b8a 100644 --- a/internal/service/rpc/coordinator.go +++ b/internal/service/rpc/coordinator.go @@ -33,7 +33,7 @@ type Task struct { } type TimeoutManager struct { - CancelFunc context.CancelFunc + CancelFunc *context.CancelFunc Mutex *sync.Mutex } @@ -206,7 +206,7 @@ func (r *Coordinator) StartTimeoutManager() { mu := &sync.Mutex{} r.TimeoutManager = &TimeoutManager{ - CancelFunc: cancel, + CancelFunc: &cancel, Mutex: mu, }