aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
authorpacien2022-10-30 01:31:47 +0200
committerpacien2022-10-30 01:34:32 +0200
commitf23c5e5b2cc837093e029884eae1f2edeaa4c888 (patch)
tree1f9cce1f4368ad951c6f0d9cc2a64fde8875b132 /compiler/src
parent0fddc74a3f9add47841124b4d77b097f4646d14f (diff)
downloadldgallery-f23c5e5b2cc837093e029884eae1f2edeaa4c888.tar.gz
compiler: add log messages for early steps
This adds some messages signaling that the compiler is doing something when it is enumerating the input tree and reading metadata files, which may take a while on systems with slow IO such as when using a network share. GitHub: closes #344
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/Compiler.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs
index 4111f02..d92d8e9 100644
--- a/compiler/src/Compiler.hs
+++ b/compiler/src/Compiler.hs
@@ -85,7 +85,8 @@ loadGalleryIndex path =
85 doesFileExist path >>= bool (return Nothing) decodeIndex 85 doesFileExist path >>= bool (return Nothing) decodeIndex
86 where 86 where
87 decodeIndex = 87 decodeIndex =
88 JSON.eitherDecodeFileStrict path 88 putStrLn ("Loading previous index:\t" ++ path)
89 >> JSON.eitherDecodeFileStrict path
89 >>= either (\err -> warn err >> return Nothing) (return . Just) 90 >>= either (\err -> warn err >> return Nothing) (return . Just)
90 warn = putStrLn . ("Warning:\tUnable to reuse existing index as cache: " ++) 91 warn = putStrLn . ("Warning:\tUnable to reuse existing index as cache: " ++)
91 92
@@ -136,10 +137,13 @@ compileGallery configPath inputDirPath outputDirPath outputIndexPath excludedDir
136 do 137 do
137 config <- readConfig $ inputGalleryConf configPath 138 config <- readConfig $ inputGalleryConf configPath
138 139
140 putStrLn "Inventorying input files"
139 inputDir <- readDirectory inputDirPath 141 inputDir <- readDirectory inputDirPath
140 excludedCanonicalDirs <- mapM canonicalizePath excludedDirs 142 excludedCanonicalDirs <- mapM canonicalizePath excludedDirs
143
141 let sourceFilter = galleryDirFilter config excludedCanonicalDirs 144 let sourceFilter = galleryDirFilter config excludedCanonicalDirs
142 let sourceTree = filterDir sourceFilter inputDir 145 let sourceTree = filterDir sourceFilter inputDir
146 putStrLn "Reading input metadata"
143 inputTree <- readInputTree sourceTree 147 inputTree <- readInputTree sourceTree
144 let curatedInputTree = filterInputTree (inputTreeFilter config) inputTree 148 let curatedInputTree = filterInputTree (inputTreeFilter config) inputTree
145 149