diff options
author | John Cai <jcai@gitlab.com> | 2022-07-26 22:06:59 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-08-18 16:43:51 +0300 |
commit | ca14762eea2a8a2b1eb64f218502653a2c2fb1a6 (patch) | |
tree | 4392275aaeba37c148752199c8cd0a1dbc86eb91 | |
parent | 4fed641e6d96a37870a48095ac093e98d63ab653 (diff) |
cgroups: Call GetGitalyProcessTempDir()
Now that we have a GetGitalyProcessTempDir() function, call it to get
the name of the cgroup directory.
-rw-r--r-- | internal/cgroups/v1_linux.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index 57552230c..103a80373 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -3,6 +3,7 @@ package cgroups import ( "fmt" "hash/crc32" + "path/filepath" "strings" "github.com/containerd/cgroups" @@ -10,6 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "gitlab.com/gitlab-org/gitaly/v15/internal/command" "gitlab.com/gitlab-org/gitaly/v15/internal/git/repository" + "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config" cgroupscfg "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config/cgroups" "gitlab.com/gitlab-org/gitaly/v15/internal/log" ) @@ -215,11 +217,11 @@ func (cg *CGroupV1Manager) Cleanup() error { } func (cg *CGroupV1Manager) repoPath(groupID int) string { - return fmt.Sprintf("%s/repos-%d", cg.currentProcessCgroup(), groupID) + return filepath.Join(cg.currentProcessCgroup(), fmt.Sprintf("repos-%d", groupID)) } func (cg *CGroupV1Manager) currentProcessCgroup() string { - return fmt.Sprintf("/%s/gitaly-%d", cg.cfg.HierarchyRoot, cg.pid) + return config.GetGitalyProcessTempDir(cg.cfg.HierarchyRoot, cg.pid) } func defaultSubsystems(root string) ([]cgroups.Subsystem, error) { |