This commit is contained in:
voidlizard 2025-07-11 15:06:30 +03:00
parent 9b123448f4
commit 4f5842ef7f
1 changed files with 20 additions and 14 deletions

View File

@ -281,9 +281,13 @@ ncqLocate2 ncq@NCQStorage2{..} href = flip runContT pure $ callCC \exit -> do
-- atomically $ modifyTVar' ncqWrites succ
-- FIXME: race
-- merge can-delete-file-while-in-use
tracked <- readTVarIO ncqTrackedFiles <&> HPSQ.toList
for_ tracked $ \(fk, prio, mCached) -> case mCached of
for_ tracked $ \(fk, prio, mCached) -> do
case mCached of
Just CachedEntry{..} -> do
lookupEntry href (cachedMmapedIdx, cachedNway) >>= \case
Nothing -> none
@ -713,6 +717,8 @@ ncqWaitTasks NCQStorage2{..} = atomically do
tno <- readTVar ncqStorageTasks
when (tno > 0) STM.retry
-- FIXME: sometime-causes-no-such-file-or-directory
ncqStorageMergeStep :: MonadUnliftIO m => NCQStorage2 -> m Bool
ncqStorageMergeStep ncq@NCQStorage2{..} = ncqRunTask ncq False $ flip runContT pure do