Skip to content

Commit

Permalink
fix delete all
Browse files Browse the repository at this point in the history
  • Loading branch information
Time Hoo committed Apr 12, 2022
1 parent 9859a98 commit 5f20d79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ZooKeeper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module ZooKeeper
, zookeeperClose
) where

import Control.Exception (catch)
import Control.Monad (void, when, zipWithM, (<=<))
import Data.Bifunctor (first)
import Data.Maybe (fromMaybe)
Expand Down Expand Up @@ -265,7 +266,7 @@ zooDeleteAll :: HasCallStack => T.ZHandle -> CBytes -> IO ()
zooDeleteAll zh path = do
T.StringsCompletion (T.StringVector children) <- zooGetChildren zh path
mapM_ (zooDeleteAll zh <=< ZF.join path) children
zooDelete zh path Nothing
catch (zooDelete zh path Nothing) (\(_::E.ZNONODE) -> pure ())

-- | Checks the existence of a node in zookeeper.
--
Expand Down

0 comments on commit 5f20d79

Please sign in to comment.