mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fixing task deleting to be similar to task getter
This commit is contained in:
@@ -107,9 +107,16 @@ func deleteTask(ctx context.Context, url string, task *models.Task) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp, err := client.Do(req); err != nil {
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else if resp.StatusCode != http.StatusAccepted {
|
}
|
||||||
|
defer func() {
|
||||||
|
io.Copy(ioutil.Discard, resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
|
}()
|
||||||
|
|
||||||
|
if resp.StatusCode != http.StatusAccepted {
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user