Răsfoiți Sursa

fix(worker): do not init cgroup if it's not enabled

bigeagle 9 ani în urmă
părinte
comite
f6d53c16d6
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      worker/worker.go

+ 3 - 1
worker/worker.go

@@ -53,7 +53,9 @@ func GetTUNASyncWorker(cfg *Config) *Worker {
 		w.httpClient = httpClient
 	}
 
-	initCgroup(cfg.Cgroup.BasePath)
+	if cfg.Cgroup.Enable {
+		initCgroup(cfg.Cgroup.BasePath)
+	}
 	w.initJobs()
 	w.makeHTTPServer()
 	tunasyncWorker = w