实现HTTP部分功能

This commit is contained in:
刘祥超
2020-09-26 08:07:07 +08:00
parent 8aeebab4de
commit c34459db16
39 changed files with 1960 additions and 230 deletions

View File

@@ -32,7 +32,8 @@ func (this *NodeStatusExecutor) Listen() {
this.cpuUpdatedTime = time.Now()
this.update()
ticker := time.NewTicker(60 * time.Second)
// TODO 这个时间间隔可以配置
ticker := time.NewTicker(30 * time.Second)
for range ticker.C {
this.isFirstTime = false
this.update()
@@ -40,8 +41,13 @@ func (this *NodeStatusExecutor) Listen() {
}
func (this *NodeStatusExecutor) update() {
if sharedNodeConfig == nil {
return
}
status := &NodeStatus{}
status.Version = teaconst.Version
status.BuildVersion = teaconst.Version
status.ConfigVersion = sharedNodeConfig.Version
status.IsActive = true
hostname, _ := os.Hostname()