Skip to content

Commit

Permalink
fix(gRPC): create new context to avoid context cancel (#798)
Browse files Browse the repository at this point in the history
- Initialize a new background context in the `Send` function

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy authored Jul 18, 2024
1 parent a82bebe commit a7ca587
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
}

go func() {
ctx := context.Background()
_, err := notify.SendNotification(ctx, &notification, s.cfg)
if err != nil {
logx.LogError.Error(err)
Expand Down

0 comments on commit a7ca587

Please sign in to comment.