robustify against influxdb out-of-retention stores
parent
4fa7b30f50
commit
1640e7b509
|
@ -114,8 +114,14 @@ void InfluxPusher::doSend(const set<std::string>& buffer)
|
|||
infl.open ("infl.txt", std::ofstream::out | std::ofstream::app);
|
||||
infl << newout;
|
||||
*/
|
||||
|
||||
mc.postURL("http://127.0.0.1:8086/write?db="+d_dbname, newout, mch);
|
||||
try {
|
||||
mc.postURL("http://127.0.0.1:8086/write?db="+d_dbname, newout, mch);
|
||||
}
|
||||
catch(std::exception& e) {
|
||||
if(strstr(e.what(), "retention"))
|
||||
return;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ std::string MiniCurl::postURL(const std::string& str, const std::string& postdat
|
|||
if(res != CURLE_OK || http_code >= 300 ) {
|
||||
cerr<<"Detailed error: "<<d_data<<endl;
|
||||
cerr<<postdata<<endl;
|
||||
throw std::runtime_error("Unable to post URL ("+std::to_string(http_code)+"): "+string(curl_easy_strerror(res)));
|
||||
throw std::runtime_error("Unable to post URL ("+std::to_string(http_code)+"): "+string(curl_easy_strerror(res))+", detail: "+d_data);
|
||||
}
|
||||
|
||||
std::string ret=d_data;
|
||||
|
|
Loading…
Reference in New Issue