From 5f20d79094027b5cd19ad4a90f048d740bba769c Mon Sep 17 00:00:00 2001 From: Time Hoo Date: Tue, 12 Apr 2022 18:21:11 +0800 Subject: [PATCH] fix delete all --- src/ZooKeeper.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZooKeeper.hs b/src/ZooKeeper.hs index b75a8ab..422e65c 100644 --- a/src/ZooKeeper.hs +++ b/src/ZooKeeper.hs @@ -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) @@ -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. --