diff --git a/src/actsim_agent/downloader.cpp b/src/actsim_agent/downloader.cpp index ee79ff2..6d1cc75 100644 --- a/src/actsim_agent/downloader.cpp +++ b/src/actsim_agent/downloader.cpp @@ -36,6 +36,7 @@ #include #include #include +#include "actsim_agent.hpp" #include "agent_artifact.hpp" #include "cluster/db_types.hpp" #include "pqxx/prepared_statement.hxx" @@ -79,6 +80,8 @@ void Downloader::thread_run() { // make sure we weren't woken up because the program closed if (!this->interface.running()) break; + if (this->interface.get_buffer_space() < DOWNLOAD_BUFFER * 0.8) continue; + // if the download buffer is not full, fetch some more tasks if (!this->fetch_tasks(this->interface.get_buffer_space())) { // we can sleep for a certain amount of time, nothing to do