diff options
author | John Cai <jcai@gitlab.com> | 2022-07-26 22:06:59 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-08-22 16:05:04 +0300 |
commit | 9098ae35168004c7ab0d1487d9447757f47de3d1 (patch) | |
tree | 47558a23a18720761993d701a8d06787fc683cb3 /internal | |
parent | 63f16bfe67f7ba561652722e90793b219a2b3960 (diff) |
cgroups: Call GetGitalyProcessTempDir()
Now that we have a GetGitalyProcessTempDir() function, call it to get
the name of the cgroup directory.
Diffstat (limited to 'internal')
-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 ec2fdb731..819abbbe8 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) { |