mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Review feedback
This commit is contained in:
@@ -34,10 +34,10 @@ func checkPipe(pr PipeRouter, end End) CtxHandlerFunc {
|
||||
id := mux.Vars(r)["pipeID"]
|
||||
_, _, ok := pr.Get(ctx, id, end)
|
||||
if !ok {
|
||||
http.NotFound(w, r)
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
defer pr.Release(ctx, id, end)
|
||||
pr.Release(ctx, id, end)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,17 +218,17 @@ export function getPipeStatus(pipeId) {
|
||||
reqwest({
|
||||
method: 'GET',
|
||||
url: url,
|
||||
success: function(res) {
|
||||
log('ERROR: expected responses: [200, 404]. Got:', res);
|
||||
},
|
||||
error: function(err) {
|
||||
log('ERROR: unexpected response:', err);
|
||||
},
|
||||
success: function(res) {
|
||||
const status = {
|
||||
200: 'PIPE_ALIVE',
|
||||
404: 'PIPE_DELETED'
|
||||
}[err.status];
|
||||
204: 'PIPE_DELETED'
|
||||
}[res.status];
|
||||
|
||||
if (!status) {
|
||||
log('Unexpected pipe status:', err.status);
|
||||
log('Unexpected pipe status:', res.status);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user