From 5052d6c09d37aedc49348c94178b8b8586571b80 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:32:41 -0600 Subject: [PATCH] unzip once eos uploaded --- src/Handler/Admin.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index ea60877..038e7f7 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -23,6 +23,7 @@ import Data.Aeson ( (.:?), (.=), ) +import Data.Conduit.Zlib (ungzip) import Data.HashMap.Internal.Strict ( HashMap, differenceWith, @@ -192,7 +193,7 @@ postEosUploadR = do createDirectoryIfMissing True resourcesTemp withTempDirectory resourcesTemp "neweos" $ \dir -> do let path = dir "eos" <.> "img" - runConduit $ rawRequestBody .| sinkFile path + runConduit $ rawRequestBody .| ungzip .| sinkFile path void . runDB $ upsert (EosHash version hash) [EosHashHash =. hash] let targetPath = root show version removePathForcibly targetPath