Parcourir la source

fix(performance): refine process distinction for Nginx worker and cache processes

Jacky il y a 3 semaines
Parent
commit
402de5d987
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      internal/performance/process_info.go

+ 2 - 2
internal/performance/process_info.go

@@ -119,9 +119,9 @@ func GetNginxProcessInfo() (*NginxProcessInfo, error) {
 		}
 
 		// Distinguish between worker processes, cache processes, and other processes
-		if ppid == masterPID || strings.Contains(cmdline, "worker process") {
+		if ppid == masterPID && strings.Contains(cmdline, "worker process") {
 			workerCount++
-		} else if strings.Contains(cmdline, "cache") {
+		} else if ppid == masterPID && strings.Contains(cmdline, "cache") {
 			cacheCount++
 		} else {
 			otherCount++