(method, contentType, url string, body string)
| 311 | } |
| 312 | |
| 313 | func runWithRetriesForResp(method, contentType, url string, body string) ( |
| 314 | *x.QueryResWithData, []byte, *http.Response, error) { |
| 315 | |
| 316 | req, err := createRequest(method, contentType, url, body) |
| 317 | if err != nil { |
| 318 | return nil, nil, nil, err |
| 319 | } |
| 320 | |
| 321 | qr, respBody, resp, err := runRequest(req) |
| 322 | if err != nil && strings.Contains(err.Error(), "Token is expired") { |
| 323 | if err := token.refreshToken(); err != nil { |
| 324 | return nil, nil, nil, err |
| 325 | } |
| 326 | |
| 327 | // create a new request since the previous request would have been closed upon the err |
| 328 | retryReq, err := createRequest(method, contentType, url, body) |
| 329 | if err != nil { |
| 330 | return nil, nil, resp, err |
| 331 | } |
| 332 | |
| 333 | return runRequest(retryReq) |
| 334 | } |
| 335 | return qr, respBody, resp, err |
| 336 | } |
| 337 | |
| 338 | func commitWithTs(mr mutationResponse, abort bool) error { |
| 339 | url := addr + "/commit" |
no test coverage detected
searching dependent graphs…