diff options
author | defanor <defanor@uberspace.net> | 2018-02-08 11:09:40 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2018-02-08 11:09:40 +0300 |
commit | 99cd9c84abf3c52970981499875b402d5fb68085 (patch) | |
tree | 109abe4498175aeed7d3e270ed1d6f8074b4af43 /Pancake/Configuration.hs | |
parent | 11e83528df0f4e48d9324b2e4dd82dc58792fb16 (diff) |
Introduce pandoc timeouts
Sometimes pandoc takes unreasonably long time to parse a
document (though it warns about that in the documentation), so a
safeguard is needed.
Diffstat (limited to 'Pancake/Configuration.hs')
-rw-r--r-- | Pancake/Configuration.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Pancake/Configuration.hs b/Pancake/Configuration.hs index 9df236a..9b0f83d 100644 --- a/Pancake/Configuration.hs +++ b/Pancake/Configuration.hs @@ -69,6 +69,9 @@ data Config = Config { commands :: M.Map String String -- inside divs. , unclutter :: M.Map String String -- ^ XSLT file and URI regex. + , pandocTimeout :: Int + -- ^ Maximum amount of time (in seconds) allowed + -- for document parsing. } deriving (Generic, Show, Eq) -- | For configuration parsing. @@ -117,6 +120,7 @@ instance Default Config where "^https://news\\.ycombinator\\.com/((news|show|ask).*)?$") , ("mediawiki", "^https://en\\.(m.)?(wiktionary|wikipedia)\\.org/wiki/") , ("github", "^https://github\\.com/")] + , pandocTimeout = 60 } where curl = "curl -A \"pancake/${PANCAKE}\" --compressed -4 -L " ++ |