MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / Start

Method Start

internal/nodes/http_cache_task_manager.go:71–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69}
70
71func (this *HTTPCacheTaskManager) Start() {
72 // task queue
73 goman.New(func() {
74 rpcClient, _ := rpc.SharedRPC()
75
76 if rpcClient != nil {
77 for taskReq := range this.taskQueue {
78 _, err := rpcClient.ServerRPC.PurgeServerCache(rpcClient.Context(), taskReq)
79 if err != nil {
80 remotelogs.Error("HTTP_CACHE_TASK_MANAGER", "create purge task failed: "+err.Error())
81 }
82 }
83 }
84 })
85
86 // Loop
87 for range this.ticker.C {
88 err := this.Loop()
89 if err != nil {
90 remotelogs.Error("HTTP_CACHE_TASK_MANAGER", "execute task failed: "+err.Error())
91 }
92 }
93}
94
95func (this *HTTPCacheTaskManager) Loop() error {
96 rpcClient, err := rpc.SharedRPC()

Callers

nothing calls this directly

Calls 6

LoopMethod · 0.95
NewFunction · 0.92
SharedRPCFunction · 0.92
ErrorFunction · 0.92
ContextMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected