File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
session-loader/Development/IDE Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ runWithDb logger fp k = do
253
253
_ <- garbageCollectTypeNames db
254
254
forever $ do
255
255
k <- atomically $ readTQueue chan
256
- retryOnSqliteBusy logger db oneSecond oneMillisecond maxRetryCount rng k
256
+ k ( retryOnSqliteBusy logger db oneSecond oneMillisecond maxRetryCount rng)
257
257
`Safe.catch` \ e@ SQLError {} -> do
258
258
logDebug logger $ T. pack $ " SQLite error in worker, ignoring: " ++ show e
259
259
`Safe.catchAny` \ e -> do
Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ indexHieFile se mod_summary srcPath !hash hf = do
521
521
-- hiedb doesn't use the Haskell src, so we clear it to avoid unnecessarily keeping it around
522
522
let ! hf' = hf{hie_hs_src = mempty }
523
523
modifyTVar' indexPending $ HashMap. insert srcPath hash
524
- writeTQueue indexQueue $ \ db -> do
524
+ writeTQueue indexQueue $ \ withHieDb -> do
525
525
-- We are now in the worker thread
526
526
-- Check if a newer index of this file has been scheduled, and if so skip this one
527
527
newerScheduled <- atomically $ do
@@ -532,7 +532,7 @@ indexHieFile se mod_summary srcPath !hash hf = do
532
532
Just pendingHash -> pendingHash /= hash
533
533
unless newerScheduled $ do
534
534
pre optProgressStyle
535
- addRefsFromLoaded db targetPath (RealFile $ fromNormalizedFilePath srcPath) hash hf'
535
+ withHieDb ( \ db -> HieDb. addRefsFromLoaded db targetPath (HieDb. RealFile $ fromNormalizedFilePath srcPath) hash hf')
536
536
post
537
537
where
538
538
mod_location = ms_location mod_summary
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ setSomethingModified state keys reason = do
294
294
fail " setSomethingModified can't be called on this type of VFSHandle"
295
295
-- Update database to remove any files that might have been renamed/deleted
296
296
atomically $ do
297
- writeTQueue (indexQueue $ hiedbWriter $ shakeExtras state) deleteMissingRealFiles
297
+ writeTQueue (indexQueue $ hiedbWriter $ shakeExtras state) ( \ withHieDb -> withHieDb deleteMissingRealFiles)
298
298
modifyTVar' (dirtyKeys $ shakeExtras state) $ \ x ->
299
299
foldl' (flip HSet. insert) x keys
300
300
void $ restartShakeSession (shakeExtras state) reason []
Original file line number Diff line number Diff line change @@ -183,7 +183,9 @@ data HieDbWriter
183
183
}
184
184
185
185
-- | Actions to queue up on the index worker thread
186
- type IndexQueue = TQueue (HieDb -> IO () )
186
+ -- The inner `(HieDb -> IO ()) -> IO ()` wraps `HieDb -> IO ()`
187
+ -- with (currently) retry functionality
188
+ type IndexQueue = TQueue (((HieDb -> IO () ) -> IO () ) -> IO () )
187
189
188
190
-- | Intended to represent HieDb calls wrapped with (currently) retry
189
191
-- functionality
You can’t perform that action at this time.
0 commit comments