Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelise s3 cache probing #97

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Rome.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ library
, resourcet >= 1.1
, optparse-applicative >= 0.12
, aeson >= 0.11
, lifted-async >= 0.9

ghc-options: -Wall -fno-warn-unused-do-bind

Expand Down
8 changes: 5 additions & 3 deletions src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import qualified Data.Conduit as C (Conduit, await, yield, ($$),
(=$=))
import qualified Data.Conduit.Binary as C (sinkFile, sinkLbs,
sourceFile, sourceLbs)
import Control.Concurrent.Async.Lifted.Safe (mapConcurrently)
import qualified Data.S3Config as S3Config
import Data.Maybe (fromMaybe)
import Data.Monoid ((<>))
Expand Down Expand Up @@ -1280,9 +1281,10 @@ probeS3ForFrameworks :: S3.BucketName -- ^ The chache definition.
-> ReaderT (AWS.Env, CachePrefix, Bool) IO [FrameworkAvailability]
probeS3ForFrameworks s3BucketName
reverseRomeMap
frameworkVersions = sequence . probeForEachFramework
frameworkVersions
platforms = mapConcurrently probe frameworkVersions
where
probeForEachFramework = mapM (probeS3ForFramework s3BucketName reverseRomeMap) frameworkVersions
probe framework = probeS3ForFramework s3BucketName reverseRomeMap framework platforms



Expand All @@ -1297,7 +1299,7 @@ probeS3ForFramework s3BucketName
frameworkVersion
platforms = fmap (FrameworkAvailability frameworkVersion) probeForEachPlatform
where
probeForEachPlatform = mapM (probeS3ForFrameworkOnPlatform s3BucketName reverseRomeMap frameworkVersion) platforms
probeForEachPlatform = mapConcurrently (probeS3ForFrameworkOnPlatform s3BucketName reverseRomeMap frameworkVersion) platforms


-- | Probes the caches described by `RomeCacheInfo` to check whether a `FrameworkVersion` is present or not for a `TargetPlatform`.
Expand Down