fix: always call cancel func

This commit is contained in:
A1lo 2023-02-03 15:24:12 +08:00 committed by Shelikhoo
parent 4f2fc729ce
commit beec73e12d
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
1 changed files with 1 additions and 0 deletions

View File

@ -44,6 +44,7 @@ func (s *LoggerServer) FollowLog(_ *FollowLogRequest, stream LoggerService_Follo
return newError("logger not support following")
}
ctx, cancel := context.WithCancel(stream.Context())
defer cancel()
f := func(msg cmlog.Message) {
err := stream.Send(&FollowLogResponse{
Message: msg.String(),