mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
fixed bugs
This commit is contained in:
@@ -13,7 +13,6 @@ FROM alpine:latest
|
||||
WORKDIR /root
|
||||
COPY --from=build /go/src/app .
|
||||
COPY --from=build /go/bin/crawlab /usr/local/bin
|
||||
RUN ls
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["crawlab"]
|
||||
|
||||
@@ -223,6 +223,26 @@ func UpdateNodeStatus() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 遍历数据库中的节点列表
|
||||
nodes, err := model.GetNodeList(nil)
|
||||
for _, node := range nodes {
|
||||
hasNode := false
|
||||
for _, mac := range list {
|
||||
if mac == node.Mac {
|
||||
hasNode = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !hasNode {
|
||||
node.Status = constants.StatusOffline
|
||||
if err := node.Save(); err != nil {
|
||||
log.Errorf(err.Error())
|
||||
return
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新节点数据
|
||||
|
||||
Reference in New Issue
Block a user