@@ -73,7 +73,6 @@ func NewInternalHostHandler(i *do.Injector) (*InternalHostHandler, error) {
7373 g .POST ("/coding-config" , web .BindHandler (h .GetCodingConfig ))
7474 g .POST ("/git-credential" , web .BindHandler (h .GitCredential ))
7575 g .GET ("/vm/list" , web .BaseHandler (h .VMList ))
76- g .POST ("/vm/activity" , web .BindHandler (h .VMActivity ))
7776 g .POST ("/task-stream-ips" , web .BindHandler (h .GetTaskStreamIPs ))
7877
7978 return h , nil
@@ -358,14 +357,6 @@ func (h *InternalHostHandler) VmReady(c *web.Context, req taskflow.VirtualMachin
358357 }
359358 }
360359
361- go func () {
362- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
363- defer cancel ()
364- if err := h .hostUsecase .RefreshIdleTimers (ctx , vm .ID ); err != nil {
365- h .logger .With ("error" , err ).ErrorContext (ctx , "failed to refresh idel timers" )
366- }
367- }()
368-
369360 }
370361
371362 return c .Success (nil )
@@ -474,26 +465,6 @@ func (h *InternalHostHandler) GitCredential(c *web.Context, req taskflow.GitCred
474465 })
475466}
476467
477- // VMActivityReq VM 活动上报请求
478- type VMActivityReq struct {
479- VMID string `json:"vm_id"`
480- LastActiveAt int64 `json:"last_active_at"`
481- }
482-
483- // VMActivity VM 活动回调,用于刷新空闲计时器
484- func (h * InternalHostHandler ) VMActivity (c * web.Context , req VMActivityReq ) error {
485- h .logger .With ("req" , req ).DebugContext (c .Request ().Context (), "vm activity req" )
486-
487- go func () {
488- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
489- defer cancel ()
490- if err := h .hostUsecase .RefreshIdleTimers (ctx , req .VMID ); err != nil {
491- h .logger .With ("error" , err ).ErrorContext (ctx , "failed to refresh idel timers" )
492- }
493- }()
494- return c .Success (nil )
495- }
496-
497468// GetTaskStreamIPs 获取任务 WebSocket 连接的客户端 IP
498469func (h * InternalHostHandler ) GetTaskStreamIPs (c * web.Context , req taskflow.GetTaskStreamIPsReq ) error {
499470 var ips []string
0 commit comments