mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-03 12:46:43 +00:00
Create directory before locking lock file (#2160)
This commit is contained in:
parent
d8350d62b0
commit
2d54c9693b
@ -414,6 +414,11 @@ func (d *File) TryLock() error {
|
||||
}
|
||||
|
||||
lockFile := flock.New(d.path + ".lock")
|
||||
err := createFileDirectoryIfDoesntExist(lockFile.Path())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
flockMap[d.path] = lockFile
|
||||
|
||||
success, err := lockFile.TryLock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user