Skip to content

Commit

Permalink
Add a 1ms delay before inserting, as not to overload the DB connection
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Feb 9, 2022
1 parent c76572b commit b390f34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Flora/Import/Package.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# OPTIONS_GHC -Wno-unused-imports #-}
module Flora.Import.Package where

import Control.Concurrent
import Control.Monad.Except
import qualified Data.ByteString as B
import Data.Map (Map)
Expand Down Expand Up @@ -132,6 +133,7 @@ importCabal userId namespace packageName directory = do
case result of
Left err -> error $ "Encountered error during import: " <> show err
Right (package, release, components, requirements) -> do
liftIO $ threadDelay 1000 -- 1ms
publishPackage requirements components release package

importPackageDeps :: PackageName -> FilePath -> DBT IO (Map PackageName (Set PackageName))
Expand Down

0 comments on commit b390f34

Please sign in to comment.