INotify.removeWatch can crash
Unsure why, possibly if the file has been replaced by another file.
This commit is contained in:
parent
7503b8448b
commit
ff2dc5eb18
1 changed files with 3 additions and 2 deletions
|
@ -193,7 +193,7 @@ tailVerify iv f finished =
|
||||||
(Just <$> readTMVar hv)
|
(Just <$> readTMVar hv)
|
||||||
`orElse`
|
`orElse`
|
||||||
((const Nothing) <$> readTMVar finished)
|
((const Nothing) <$> readTMVar finished)
|
||||||
INotify.removeWatch wd
|
void $ tryNonAsync $ INotify.removeWatch wd
|
||||||
return v
|
return v
|
||||||
|
|
||||||
inotifycreate i cont = INotify.addWatch i evs (P.takeDirectory f) $ \case
|
inotifycreate i cont = INotify.addWatch i evs (P.takeDirectory f) $ \case
|
||||||
|
@ -231,8 +231,9 @@ tailVerify iv f finished =
|
||||||
wd <- INotify.addWatch i [INotify.Modify] f $ \_event ->
|
wd <- INotify.addWatch i [INotify.Modify] f $ \_event ->
|
||||||
atomically $ void $ tryPutTMVar modified ()
|
atomically $ void $ tryPutTMVar modified ()
|
||||||
r <- follow h modified
|
r <- follow h modified
|
||||||
INotify.removeWatch wd
|
void $ tryNonAsync $ INotify.removeWatch wd
|
||||||
return r
|
return r
|
||||||
|
|
||||||
-- File never showed up, but we've been told it's done being
|
-- File never showed up, but we've been told it's done being
|
||||||
-- written to.
|
-- written to.
|
||||||
go' _ Nothing = do
|
go' _ Nothing = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue