Skip to content

Commit

Permalink
Clear index cache whenever index updated #1962
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Mar 30, 2016
1 parent e3d7f59 commit 1c89cb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/Stack/Fetch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ withCabalLoader menv inner = do
, "Updating and trying again."
]
updateAllIndices menv
clearPackageCaches
caches <- getPackageCaches
liftIO $ writeIORef icaches caches
return (False, doLookup ident)
Expand Down
4 changes: 2 additions & 2 deletions src/Stack/PackageIndex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module Stack.PackageIndex
( updateAllIndices
, getPackageCaches
, getPackageVersions
, clearPackageCaches
) where

import qualified Codec.Archive.Tar as Tar
Expand Down Expand Up @@ -200,7 +199,8 @@ updateAllIndices
,HasConfig env,MonadBaseControl IO m, MonadCatch m)
=> EnvOverride
-> m ()
updateAllIndices menv =
updateAllIndices menv = do
clearPackageCaches
asks (configPackageIndices . getConfig) >>= mapM_ (updateIndex menv)

-- | Update the index tarball
Expand Down

0 comments on commit 1c89cb5

Please sign in to comment.