Skip to content

Commit 5f20d79

Browse files
author
Time Hoo
committed
fix delete all
1 parent 9859a98 commit 5f20d79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ZooKeeper.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module ZooKeeper
3636
, zookeeperClose
3737
) where
3838

39+
import Control.Exception (catch)
3940
import Control.Monad (void, when, zipWithM, (<=<))
4041
import Data.Bifunctor (first)
4142
import Data.Maybe (fromMaybe)
@@ -265,7 +266,7 @@ zooDeleteAll :: HasCallStack => T.ZHandle -> CBytes -> IO ()
265266
zooDeleteAll zh path = do
266267
T.StringsCompletion (T.StringVector children) <- zooGetChildren zh path
267268
mapM_ (zooDeleteAll zh <=< ZF.join path) children
268-
zooDelete zh path Nothing
269+
catch (zooDelete zh path Nothing) (\(_::E.ZNONODE) -> pure ())
269270

270271
-- | Checks the existence of a node in zookeeper.
271272
--

0 commit comments

Comments
 (0)