MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / getDownloadProcess

Function getDownloadProcess

agent/utils/websocket/process_data.go:142–158  ·  view source on GitHub ↗
(progress DownloadProgress)

Source from the content-addressed store, hash-verified

140}
141
142func getDownloadProcess(progress DownloadProgress) (res []byte, err error) {
143 var result []files.Process
144 for _, k := range progress.Keys {
145 value := global.CACHE.Get(k)
146 if value == "" {
147 continue
148 }
149 downloadProcess := &files.Process{}
150 _ = json.Unmarshal([]byte(value), downloadProcess)
151 result = append(result, *downloadProcess)
152 if downloadProcess.Percent == 100 {
153 global.CACHE.Del(k)
154 }
155 }
156 res, err = json.Marshal(result)
157 return
158}
159
160func handleProcessData(proc *process.Process, processConfig *PsProcessConfig, pidConnections map[int32][]net.ConnectionStat) *PsProcessData {
161 if processConfig.Pid > 0 && processConfig.Pid != proc.Pid {

Callers 1

ProcessDataFunction · 0.85

Calls 2

DelMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected