Skip to content

Commit

Permalink
Cleanup retrySendTimeout func creation (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
esimkowitz authored Jan 31, 2025
1 parent 5db84e5 commit a8dd0b7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions pkg/wshutil/wshrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,21 +736,21 @@ func (w *WshRpc) setServerDone() {
}

func (w *WshRpc) retrySendTimeout(resId string) {
done := func() bool {
w.Lock.Lock()
defer w.Lock.Unlock()
if w.ServerDone {
return true
}
select {
case w.CtxDoneCh <- resId:
return true
default:
return false
}
}
for {
done := func() bool {
w.Lock.Lock()
defer w.Lock.Unlock()
if w.ServerDone {
return true
}
select {
case w.CtxDoneCh <- resId:
return true
default:
return false
}
}()
if done {
if done() {
return
}
time.Sleep(100 * time.Millisecond)
Expand Down

0 comments on commit a8dd0b7

Please sign in to comment.