From f23c5e5b2cc837093e029884eae1f2edeaa4c888 Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 30 Oct 2022 01:31:47 +0200 Subject: 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 --- compiler/src/Compiler.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler') 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 = doesFileExist path >>= bool (return Nothing) decodeIndex where decodeIndex = - JSON.eitherDecodeFileStrict path + putStrLn ("Loading previous index:\t" ++ path) + >> JSON.eitherDecodeFileStrict path >>= either (\err -> warn err >> return Nothing) (return . Just) warn = putStrLn . ("Warning:\tUnable to reuse existing index as cache: " ++) @@ -136,10 +137,13 @@ compileGallery configPath inputDirPath outputDirPath outputIndexPath excludedDir do config <- readConfig $ inputGalleryConf configPath + putStrLn "Inventorying input files" inputDir <- readDirectory inputDirPath excludedCanonicalDirs <- mapM canonicalizePath excludedDirs + let sourceFilter = galleryDirFilter config excludedCanonicalDirs let sourceTree = filterDir sourceFilter inputDir + putStrLn "Reading input metadata" inputTree <- readInputTree sourceTree let curatedInputTree = filterInputTree (inputTreeFilter config) inputTree -- cgit v1.2.3