diff --git a/source/app.d b/source/app.d index f170700..d3f476e 100644 --- a/source/app.d +++ b/source/app.d @@ -104,7 +104,7 @@ string url = "http://"~bindAddress~":"~bindPort.to!string~"/reload"; auto req = Request(); req.keepAlive = false; - req.timeout = REQ_TIMEOUT; + req.timeout = ACTOR_REQ_TIMEOUT; req.get(url); } catch (Exception e) { @@ -117,7 +117,7 @@ string url = "http://"~bindAddress~":"~bindPort.to!string~"/cli"; auto req = Request(); req.keepAlive = false; - req.timeout = REQ_TIMEOUT; + req.timeout = ACTOR_REQ_TIMEOUT; req.get(url); } catch (Exception e) { diff --git a/source/cartastraccia/actor.d b/source/cartastraccia/actor.d index dafe622..c7f565e 100644 --- a/source/cartastraccia/actor.d +++ b/source/cartastraccia/actor.d @@ -23,8 +23,8 @@ alias TaskMap = Task[string]; -immutable uint MAX_RETRIES = 3; -immutable REQ_TIMEOUT = 2.seconds; +immutable uint ACTOR_MAX_RETRIES = 3; +immutable ACTOR_REQ_TIMEOUT = 5.seconds; /** * Actor in charge of: @@ -40,13 +40,13 @@ try { auto req = Request(); req.keepAlive = false; - req.timeout = REQ_TIMEOUT; + req.timeout = ACTOR_REQ_TIMEOUT; auto res = req.get(path); parseRSS(rss, cast(immutable string)res.responseBody.data); } catch (Exception e) { - if(retries < MAX_RETRIES) { + if(retries < ACTOR_MAX_RETRIES) { feedActor(feedName, path, retries+1); return; } diff --git a/source/cartastraccia/renderer.d b/source/cartastraccia/renderer.d index 66f75d4..91cf99f 100644 --- a/source/cartastraccia/renderer.d +++ b/source/cartastraccia/renderer.d @@ -41,13 +41,13 @@ itemCont.html = "
"~item.pubDate~"
" - ~ replaceAll(item.description, regex("<.*pre>"), ""); + ~ cleanup(item.description); } else { auto itemCont = doc.createElement("div", column2); itemCont.html = ""~item.pubDate~"
" - ~ replaceAll(item.description, regex("<.*pre>"), ""); + ~ cleanup(item.description); } i++; } @@ -59,3 +59,9 @@ if(existsFile(fpath)) removeFile(fpath); appendToFile(fpath, output.data); } + +private string cleanup(immutable string data) +{ + immutable res = replaceAll(data, regex("<.*pre>"), ""); + return res.replaceAll(regex("