Skip to content

Commit cc53b14

Browse files
retlehsclaude
andcommitted
Fix pipeline lock path to use DB directory instead of relative CWD
The lock file path was hardcoded as "storage/pipeline.lock" which resolves against CWD. On prod the binary runs from a different directory than where the DB lives, so the lock file's parent directory didn't exist. Derive the lock path from the configured DB path instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c35143a commit cc53b14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/wpcomposer/cmd/pipeline.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import (
1414
"github.com/spf13/cobra"
1515
)
1616

17-
const pipelineLockPath = "storage/pipeline.lock"
18-
1917
// pipelineLockFile holds the lock file reference for the lifetime of the process,
2018
// preventing the GC finalizer from closing the fd and releasing the lock.
2119
var pipelineLockFile *os.File
2220

2321
// acquirePipelineLock ensures only one pipeline runs at a time.
22+
// The lock file is placed next to the database file.
2423
func acquirePipelineLock() error {
25-
return acquireLock(pipelineLockPath)
24+
lockPath := filepath.Join(filepath.Dir(application.Config.DB.Path), "pipeline.lock")
25+
return acquireLock(lockPath)
2626
}
2727

2828
// acquireLock acquires an exclusive file lock at lockPath.

0 commit comments

Comments
 (0)