From 5f04dc6a237d0191beed76a8951f437750fd1b51 Mon Sep 17 00:00:00 2001 From: Scott Fleischman Date: Wed, 29 May 2019 17:01:50 -0700 Subject: [PATCH] Remove use of conduit Producer and Consumer. Due to deprecations: "Deprecated: Use ConduitT directly". --- Database/MongoDB/GridFS.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/MongoDB/GridFS.hs b/Database/MongoDB/GridFS.hs index 11d8c97..1f0a12c 100644 --- a/Database/MongoDB/GridFS.hs +++ b/Database/MongoDB/GridFS.hs @@ -110,7 +110,7 @@ putChunk :: (Monad m, MonadIO m) => Bucket -> ObjectId -> Int -> L.ByteString -> putChunk bucket files_id i chunk = do insert_ (chunks bucket) ["files_id" =: files_id, "n" =: i, "data" =: Binary (L.toStrict chunk)] -sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) S.ByteString +sourceFile :: (Monad m, MonadIO m) => File -> ConduitT i S.ByteString (Action m) () -- ^ A producer for the contents of a file sourceFile file = yieldChunk 0 where yieldChunk i = do @@ -179,7 +179,7 @@ writeChunks (FileWriter chunkSize bucket files_id i size acc md5context md5acc) putChunk bucket files_id i chunk writeChunks (FileWriter chunkSize bucket files_id (i+1) size' acc' md5context' md5acc') L.empty -sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> Consumer S.ByteString (Action m) File +sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> ConduitT S.ByteString o (Action m) File -- ^ A consumer that creates a file in the bucket and puts all consumed data in it sinkFile bucket filename = do files_id <- liftIO $ genObjectId