From 76658df29dbba6e183fe7c169156436cd1eb1950 Mon Sep 17 00:00:00 2001 From: jpappa200 Date: Fri, 10 Feb 2023 12:02:21 -0500 Subject: [PATCH] pass file path not config --- cache-config/t3c-apply/t3c-apply.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cache-config/t3c-apply/t3c-apply.go b/cache-config/t3c-apply/t3c-apply.go index e1d554a991..5008837a21 100644 --- a/cache-config/t3c-apply/t3c-apply.go +++ b/cache-config/t3c-apply/t3c-apply.go @@ -149,13 +149,15 @@ func Main() int { //need to see if there is an old lock file laying around. //older than 5 minutes const gitMaxLockAgeMinutes = 5 - oldLock, err := util.IsGitLockFileOld(cfg, time.Now(), gitMaxLockAgeMinutes) + const gitLock = ".git/index.lock" + gitLockFile := filepath.Join(cfg.TsConfigDir, gitLock) + oldLock, err := util.IsGitLockFileOld(gitLockFile, time.Now(), gitMaxLockAgeMinutes * time.Minute) if err != nil { log.Errorln("checking for git lock file: " + err.Error()) } if oldLock { log.Errorf("removing git lock file older than %dm", gitMaxLockAgeMinutes) - err := util.RemoveGitLock(cfg) + err := util.RemoveGitLock(gitLockFile) if err != nil { log.Errorf("couldn't remove git lock file: %v", err.Error()) }