Skip to content

Commit

Permalink
fix: check for directory lock err
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed Apr 7, 2022
1 parent 08a2312 commit 522d565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ func Lock() func() error {
log.Fatalln("Directory did not exist or file could not created")
}

m.Lock() // Will block until lock can be acquired
err = m.Lock() // Will block until lock can be acquired
if err != nil {
log.Fatalln("Directory lock could not be made")
}

// return the unlock function which user can call
return m.Unlock
Expand Down

0 comments on commit 522d565

Please sign in to comment.