Skip to content

Commit 3a87171

Browse files
committed
fix issue
1 parent 2c14342 commit 3a87171

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

coordinator/internal/controller/proxy/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ func (c *upClient) Login(ctx context.Context, genLogin func(string) (*types.Logi
123123
}
124124

125125
func handleHttpResp(resp *http.Response) (*ctypes.Response, error) {
126+
defer resp.Body.Close()
126127
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusUnauthorized {
127-
defer resp.Body.Close()
128128
var respWithData ctypes.Response
129129
// Note: Body is consumed after decoding, caller should not read it again
130130
if err := json.NewDecoder(resp.Body).Decode(&respWithData); err == nil {

coordinator/internal/controller/proxy/prover_session.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ func (c *proverSession) maintainLogin(ctx context.Context, cliMgr Client, up str
114114
waitctx := c.completionCtx
115115
c.Unlock()
116116
select {
117-
case <-waitctx.Done():
118-
return c.maintainLogin(ctx, cliMgr, up, param, phase)
119117
case <-ctx.Done():
120118
nerr = fmt.Errorf("ctx fail")
121119
return
120+
default:
122121
}
122+
<-waitctx.Done()
123+
return c.maintainLogin(ctx, cliMgr, up, param, phase)
123124
}
124125

125126
if phase < curPhase {

0 commit comments

Comments
 (0)