diff --git a/source/app.d b/source/app.d index 7da95de..7b91113 100644 --- a/source/app.d +++ b/source/app.d @@ -65,6 +65,7 @@ }, (RSSFeed[] fl) { + // n. threads == n. feeds setupWorkerThreads(fl.length.to!uint); // start tasks in charge of updating feeds diff --git a/source/cartastraccia/actor.d b/source/cartastraccia/actor.d index d07f03a..4a06824 100644 --- a/source/cartastraccia/actor.d +++ b/source/cartastraccia/actor.d @@ -33,7 +33,6 @@ RSS rss; URL url = URL(path); - requestHTTP(url, (scope HTTPClientRequest req) { req.method = HTTPMethod.GET; @@ -82,8 +81,13 @@ while(true) { // receive the webserver task - auto webTask = receiveOnly!Task; - webTask.send(FeedActorResponse.VALID); + Task webTask = receiveOnly!Task; + + if(webTask.running) webTask.send(FeedActorResponse.VALID); + else { + logWarn("Web task is not running"); + return; + } // receive the actual request receive( diff --git a/source/cartastraccia/endpoint.d b/source/cartastraccia/endpoint.d index 296cf64..904e604 100644 --- a/source/cartastraccia/endpoint.d +++ b/source/cartastraccia/endpoint.d @@ -57,6 +57,7 @@ // send data request tasks[f.name].send(FeedActorRequest.DATA_HTML); + // add valid feed to list validFeeds ~= f; }); feedList = validFeeds; diff --git a/source/cartastraccia/renderer.d b/source/cartastraccia/renderer.d index d15b243..76fee47 100644 --- a/source/cartastraccia/renderer.d +++ b/source/cartastraccia/renderer.d @@ -36,7 +36,7 @@ auto output = appender!string; doc.root.outerHTML(output); - auto fpath = NativePath(pageName); + immutable fpath = NativePath(pageName); if(existsFile(fpath)) removeFile(fpath); appendToFile(fpath, output.data); }