Skip to content

Commit

Permalink
Fix send on closed channel panic
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit committed Jan 24, 2025
1 parent 9e9fabb commit 8259aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/meta/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,11 @@ func (m *baseMeta) deleteSlice(id uint64, size uint32) {
return
}
if m.dslices != nil {
m.dslices <- Slice{Id: id, Size: size}
select {
case <-m.sessCtx.Done():
return
case m.dslices <- Slice{Id: id, Size: size}:
}
} else {
m.deleteSlice_(id, size)
}
Expand Down

0 comments on commit 8259aaf

Please sign in to comment.