Open Renegatto opened 2 months ago
This will allow a caller to work with it more accurately, catching errors if needed.
It should partially fix #1580, to be precise it could allow fixing incomplete Plutip cluster cleanup after tests.
Calling cleanupTmpDir from startKupo' like this
cleanupTmpDir
startKupo'
_ <- Aff.forkAff $ logErrorWhenLeft =<< try (cleanupTmpDir process workdir)
Would prevent any event handler error from killing the app before the full plutip cluster cleanup is done.
cleanupTmpDir :: ManagedProcess -> FilePath -> Aff Unit cleanupTmpDir (ManagedProcess _ child _) workingDir = Aff.makeAff \callback -> do isCancelled <- Ref.new false let cancel = void $ Ref.modify (const true) isCancelled ChildProcess.onExit child \_ -> Ref.read isCancelled >>= flip unless do try (_rmdirSync workingDir) >>= callback pure $ Aff.effectCanceler cancel
Why
This will allow a caller to work with it more accurately, catching errors if needed.
Affected issues
It should partially fix #1580, to be precise it could allow fixing incomplete Plutip cluster cleanup after tests.
Calling
cleanupTmpDir
fromstartKupo'
like thisWould prevent any event handler error from killing the app before the full plutip cluster cleanup is done.
Implementation