Skip to content

Commit

Permalink
fix: lock was not released in time
Browse files Browse the repository at this point in the history
Signed-off-by: fengjun2016 <[email protected]>
  • Loading branch information
fengjun2016 committed Aug 16, 2024
1 parent 2736a8b commit 9272b58
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (w *watcherImpl) Get(ctx context.Context, channel string) *types.PChannelIn
// Watch watches the channel assignment.
func (w *watcherImpl) Watch(ctx context.Context, channel string, previous *types.PChannelInfoAssigned) error {
w.cond.L.Lock()
defer w.cond.L.Unlock()

term := types.InitialTerm
if previous != nil {
Expand All @@ -98,7 +99,7 @@ func (w *watcherImpl) Watch(ctx context.Context, channel string, previous *types
return err
}
}
w.cond.L.Unlock()

return nil
}

Expand Down

0 comments on commit 9272b58

Please sign in to comment.