Skip to content
Snippets Groups Projects
Commit 9509134f authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Added a timer of 3 minutes to flush the successful Retrieve Request for reporting

parent b9b8be5d
No related branches found
No related tags found
No related merge requests found
......@@ -236,6 +236,7 @@ void RecallReportPacker::WorkerThread::run(){
bool endFound = false;
std::list <std::unique_ptr<Report>> reportedSuccessfully;
cta::utils::Timer t;
while(1) {
std::string debugType;
std::unique_ptr<Report> rep(m_parent.m_fifo.pop());
......@@ -265,8 +266,11 @@ void RecallReportPacker::WorkerThread::run(){
// m_parent.fullCheckAndFinishAsyncExecute will execute the shared half of the
// request updates (individual, asynchronous is done in rep->execute(m_parent);
if (typeid(*rep) == typeid(RecallReportPacker::ReportSuccessful)
&& m_parent.m_successfulRetrieveJobs.size() >= m_parent.RECALL_REPORT_PACKER_FLUSH_SIZE)
&& (m_parent.m_successfulRetrieveJobs.size() >= m_parent.RECALL_REPORT_PACKER_FLUSH_SIZE || t.secs() >= m_parent.RECALL_REPORT_PACKER_FLUSH_TIME )){
m_parent.m_lc.log(cta::log::INFO,"m_parent.fullCheckAndFinishAsyncExecute()");
m_parent.fullCheckAndFinishAsyncExecute();
t.reset();
}
} catch(const cta::exception::Exception& e){
//we get there because to tried to close the connection and it failed
//either from the catch a few lines above or directly from rep->execute
......
......@@ -239,6 +239,11 @@ private:
* The limit for successful reports to trigger flush.
*/
const unsigned int RECALL_REPORT_PACKER_FLUSH_SIZE = 500;
/*
* The time limit for successful reports to trigger flush.
*/
const double RECALL_REPORT_PACKER_FLUSH_TIME = 180;
};
}}}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment