Skip to content

Commit

Permalink
pass file path not config
Browse files Browse the repository at this point in the history
  • Loading branch information
jpappa200 committed Feb 10, 2023
1 parent 528b067 commit 76658df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cache-config/t3c-apply/t3c-apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 76658df

Please sign in to comment.