Ignore stale nodes instead of 500 (#2357)

This commit is contained in:
Tobias Cudnik 2023-05-31 15:49:12 +02:00 committed by GitHub
parent 723375b334
commit f62eab1d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,8 +71,8 @@ func getHosts(w http.ResponseWriter, r *http.Request) {
node, err := logic.GetNodeByID(nid)
if err != nil {
logger.Log(0, r.Header.Get("user"), "failed to fetch node: ", err.Error())
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
return
// TODO find the reason for the DB error, skip this node for now
continue
}
if !isMasterAdmin && !logic.UserHasNetworksAccess([]string{node.Network}, user) {
continue