From a418e21ee241d2de9c3add64a9785800642dfc81 Mon Sep 17 00:00:00 2001 From: Pere Lev Date: Wed, 7 Aug 2024 17:43:36 +0300 Subject: [PATCH] Fix the bug fix --- src/Web/Actor/Deliver.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Web/Actor/Deliver.hs b/src/Web/Actor/Deliver.hs index ab0dec5..26f0930 100644 --- a/src/Web/Actor/Deliver.hs +++ b/src/Web/Actor/Deliver.hs @@ -223,9 +223,11 @@ startDeliveryTheater headers micros manager logFunc dbRootDir = do -- We first add the sqlite3 extension as needed entries <- listDirectory dbRootDir for_ entries $ \ path -> - if takeExtension path == "" && not ("-wal-shm" `isSuffixOf` path) && not ("-wal-wal" `isSuffixOf` path) - then renameFile (dbRootDir path) (dbRootDir path <.> "sqlite3") - else return () + if "-wal-shm" `isSuffixOf` path || "-wal-wal" `isSuffixOf` path + then return () + else if takeExtension path == ".sqlite3" + then return () + else renameFile (dbRootDir path) (dbRootDir path <.> "sqlite3") entries <- listDirectory dbRootDir let dbs = filter ((== ".sqlite3") . takeExtension) entries @@ -245,6 +247,6 @@ startDeliveryTheater headers micros manager logFunc dbRootDir = do sendHttp :: UriMode u => DeliveryTheater u -> ActorMessage (DeliveryActor u) -> [ObjURI u] -> IO () sendHttp (DeliveryTheater manager headers micros logFunc root theater) method recips = do for_ recips $ \ u -> - let makeEnv = either throwIO pure (TE.decodeUtf8' $ urlEncode False $ TE.encodeUtf8 $ renderObjURI u) >>= encodeUtf . (root ) . T.unpack >>= mkEnv (manager, headers, micros) logFunc + let makeEnv = either throwIO pure (TE.decodeUtf8' $ urlEncode False $ TE.encodeUtf8 $ renderObjURI u) >>= encodeUtf . (<.> "sqlite3") . (root ) . T.unpack >>= mkEnv (manager, headers, micros) logFunc in void $ spawnIO theater u makeEnv sendManyIO theater $ Just (HS.fromList recips, method) `H.HCons` H.HNil