mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-09 03:02:50 -06:00
(1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfo
(1) introduces the module GF.Infra.Concurreny with lifted concurrency
operators (to reduce uses of liftIO) and some additional concurrency
utilities, e.g. a function for sequential logging that is used in
both GF.CompileInParallel and GFServer.
(2) avoids leaving broken .gfo files behind if compilation is aborted.
This commit is contained in:
@@ -7,7 +7,7 @@ import System.Directory as D
|
||||
hiding (canonicalizePath,createDirectoryIfMissing,
|
||||
doesDirectoryExist,doesFileExist,getModificationTime,
|
||||
getCurrentDirectory,getDirectoryContents,getPermissions,
|
||||
removeFile)
|
||||
removeFile,renameFile)
|
||||
import Data.Time.Compat
|
||||
|
||||
canonicalizePath path = liftIO $ D.canonicalizePath path
|
||||
@@ -21,4 +21,5 @@ getCurrentDirectory :: MonadIO io => io FilePath
|
||||
getCurrentDirectory = liftIO D.getCurrentDirectory
|
||||
getPermissions path = liftIO $ D.getPermissions path
|
||||
|
||||
removeFile path = liftIO $ D.removeFile path
|
||||
removeFile path = liftIO $ D.removeFile path
|
||||
renameFile path = liftIO . D.renameFile path
|
||||
|
||||
Reference in New Issue
Block a user