Like the comment says, this works without locking. It looks like I
originally copied another function and forgot to remove the locking.
Sponsored-by: Dartmouth College's DANDI project
go logf
-- Only need to check log when there is a copy.
| deststartedwithcopy = do
- lck <- fromRepo gitAnnexMoveLock
- wasnocopy <- checkLogFile (fromRawFilePath logf) lck
+ wasnocopy <- checkLogFile (fromRawFilePath logf)
(== logline)
if wasnocopy
then go' logf False
-- action is concurrently modifying the file. It does not lock the file,
-- for speed, but instead relies on the fact that a log file usually
-- ends in a newline.
-checkLogFile :: FilePath -> RawFilePath -> (L.ByteString -> Bool) -> Annex Bool
-checkLogFile f lck matchf = withExclusiveLock lck $ bracket setup cleanup go
+checkLogFile :: FilePath -> (L.ByteString -> Bool) -> Annex Bool
+checkLogFile f matchf = bracket setup cleanup go
where
setup = liftIO $ tryWhenExists $ openFile f ReadMode
cleanup Nothing = noop