Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-01-11 13:55:50 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-01-14 17:25:03 +0300
commit8b8c314ddc9ec769db31a0b4603cc69c4f5b24ae (patch)
tree55760657b3c0d00e055bf537dbd2f78f9d135f38
parent532aec4b5020ef887bf899e984071a4c2443d283 (diff)
cmd/gitaly-wrapper: Rename function to spawn binary
The function to spawn a new wrapped binary is currently called `spawnGitaly()`, which stems from a time where it was really only used for Gitaly. Nowadays it's also used for Praefect though, so this name doesn't make a lot of sense anymore. Rename it to `spawnProcess()` to avoid any confusion.
-rw-r--r--cmd/gitaly-wrapper/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/gitaly-wrapper/main.go b/cmd/gitaly-wrapper/main.go
index 8634c9d83..247b71f2d 100644
--- a/cmd/gitaly-wrapper/main.go
+++ b/cmd/gitaly-wrapper/main.go
@@ -35,7 +35,7 @@ func main() {
logrus.Fatalf("usage: %s forking_binary [args]", os.Args[0])
}
- gitalyBin, gitalyArgs := os.Args[1], os.Args[2:]
+ binary, arguments := os.Args[1], os.Args[2:]
logger := log.Default().WithField("wrapper", os.Getpid())
logger.Info("Wrapper started")
@@ -53,12 +53,12 @@ func main() {
logger.WithError(err).Error("find process")
}
- if process != nil && isExpectedProcess(process, gitalyBin) {
+ if process != nil && isExpectedProcess(process, binary) {
logger.Info("adopting a process")
} else {
logger.Info("spawning a process")
- proc, err := spawnGitaly(gitalyBin, gitalyArgs)
+ proc, err := spawnProcess(binary, arguments)
if err != nil {
logger.WithError(err).Fatal("spawn gitaly")
}
@@ -103,7 +103,7 @@ func findProcess(pidFilePath string) (*os.Process, error) {
return nil, nil
}
-func spawnGitaly(bin string, args []string) (*os.Process, error) {
+func spawnProcess(bin string, args []string) (*os.Process, error) {
cmd := exec.Command(bin, args...)
cmd.Env = append(os.Environ(), fmt.Sprintf("%s=true", bootstrap.EnvUpgradesEnabled))