Skip to content

Commit

Permalink
删除worker自动注册
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Jan 18, 2023
1 parent e69e3b2 commit ea89186
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
26 changes: 0 additions & 26 deletions internal/workhub/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,9 @@ package workhub

import (
"tdp-cloud/helper/json"
"tdp-cloud/internal/dborm/machine"
history "tdp-cloud/internal/dborm/task_history"
)

// 主机

func createMachine(node *Worker) {

item := &machine.CreateParam{
UserId: node.UserId,
VendorId: 0,
HostName: node.HostName,
IpAddress: node.Conn.RemoteAddr().String(),
OSType: node.OSType,
Region: "",
Model: "worker",
CloudId: node.HostId,
CloudMeta: json.ToString(node.SystemStat),
Description: "",
Status: "{}",
}

machine.Create(item)

}

func deleteMachine(node *Worker) {
}

// 任务历史

func createHistory(pod *SendPod, data *ExecPayload) uint {
Expand Down
3 changes: 0 additions & 3 deletions internal/workhub/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ func Register(c *gin.Context) {
nodePool[hostId] = worker
defer delete(nodePool, hostId)

createMachine(worker)
defer deleteMachine(worker)

// 启动服务

Daemon(worker)
Expand Down

0 comments on commit ea89186

Please sign in to comment.