Make sure compressor is run during idle times too
This commit is contained in:
parent
52aece6557
commit
3fc4609210
1 changed files with 6 additions and 5 deletions
|
@ -98,7 +98,12 @@ unpackWorker
|
|||
-> TChan (Bool, Entity Stackage, TVar UnpackStatus)
|
||||
-> IO ()
|
||||
unpackWorker dirs runDB store messageVar workChan = do
|
||||
atomically $ writeTVar messageVar "Waiting for new work item"
|
||||
let say' = atomically . writeTVar messageVar
|
||||
say' "Running the compressor"
|
||||
let shouldStop = fmap not $ atomically $ isEmptyTChan workChan
|
||||
handleAny print $ runCompressor shouldStop say' dirs
|
||||
|
||||
say' "Waiting for new work item"
|
||||
(forceUnpack, ent, resVar) <- atomically $ readTChan workChan
|
||||
shouldUnpack <-
|
||||
if forceUnpack
|
||||
|
@ -122,10 +127,6 @@ unpackWorker dirs runDB store messageVar workChan = do
|
|||
Left e -> USFailed $ tshow e
|
||||
Right () -> USReady
|
||||
|
||||
say "Running the compressor"
|
||||
let shouldStop = fmap not $ atomically $ isEmptyTChan workChan
|
||||
runCompressor shouldStop say dirs
|
||||
|
||||
removeTreeIfExists :: FilePath -> IO ()
|
||||
removeTreeIfExists fp = whenM (isDirectory fp) (removeTree fp)
|
||||
|
||||
|
|
Loading…
Reference in a new issue