(progress DownloadProgress)
| 140 | } |
| 141 | |
| 142 | func 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 | |
| 160 | func handleProcessData(proc *process.Process, processConfig *PsProcessConfig, pidConnections map[int32][]net.ConnectionStat) *PsProcessData { |
| 161 | if processConfig.Pid > 0 && processConfig.Pid != proc.Pid { |
no test coverage detected