|
@@ -31,12 +31,18 @@ func main() {
|
|
|
ips := qu.ObjToString(config.Sysconfig["broadcast_ips"])
|
|
|
ipsArr := strings.Split(ips, ";")
|
|
|
for _, v := range ipsArr {
|
|
|
- config.Udpclient.WriteUdp([]byte{}, mu.OP_TYPE_DATA, &net.UDPAddr{
|
|
|
+ log.Println("通知udp来取数据1:",v,config.Sysconfig["broadcast_port"],config.Udpclient.WriteUdp([]byte{}, mu.OP_TYPE_DATA, &net.UDPAddr{
|
|
|
IP: net.ParseIP(v),
|
|
|
Port: qu.IntAll(config.Sysconfig["broadcast_port"]),
|
|
|
- })
|
|
|
+ }))
|
|
|
}
|
|
|
}
|
|
|
+ for _,v:= range config.CID{
|
|
|
+ log.Println("通知udp来取数据2:",v,config.Sysconfig["broadcast_port"],config.Udpclient.WriteUdp([]byte{}, mu.OP_TYPE_DATA, &net.UDPAddr{
|
|
|
+ IP: net.ParseIP(v),
|
|
|
+ Port: qu.IntAll(config.Sysconfig["broadcast_port"]),
|
|
|
+ }))
|
|
|
+ }
|
|
|
mux := http.NewServeMux()
|
|
|
mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
|
|
|
http.Redirect(writer, request, "/login", http.StatusFound)
|
|
@@ -251,7 +257,7 @@ func reload(ip string) string {
|
|
|
return "ip不存在"
|
|
|
}
|
|
|
config.Sys.Lock()
|
|
|
- if config.CID[qu.ObjToString((*tmp)["InstanceId"])] == true {
|
|
|
+ if config.CID[qu.ObjToString((*tmp)["InstanceId"])] != "" {
|
|
|
delete(config.CID, qu.ObjToString((*tmp)["InstanceId"]))
|
|
|
}
|
|
|
config.Sys.Unlock()
|
|
@@ -281,8 +287,8 @@ func reload(ip string) string {
|
|
|
(*escObject)[0]["OcrTaskStatus"] = "successful"
|
|
|
mongodb.Update("ocr_ecs", bson.M{"_id": (*escObject)[0]["_id"]}, (*escObject)[0], true, false)
|
|
|
config.Sys.Lock()
|
|
|
- if config.CID[qu.ObjToString((*escObject)[0]["InstanceId"])] == false && qu.ObjToString((*escObject)[0]["InstanceId"]) !=""{
|
|
|
- config.CID[qu.ObjToString((*escObject)[0]["InstanceId"])] = true
|
|
|
+ if config.CID[qu.ObjToString((*escObject)[0]["InstanceId"])] == "" && qu.ObjToString((*escObject)[0]["InstanceId"]) !=""{
|
|
|
+ config.CID[qu.ObjToString((*escObject)[0]["InstanceId"])] = tmpip
|
|
|
}
|
|
|
config.Sys.Unlock()
|
|
|
log.Println((*escObject)[0]["_id"], tmpip, "部署成功")
|