[pt] don't poll if max time is set

This commit is contained in:
Timothy Stack 2015-10-04 20:50:49 -07:00
parent f11cca2366
commit 4f775dc1ae

View File

@ -131,7 +131,7 @@ struct json_path_handler papertrail_proc::FORMAT_HANDLERS[] = {
json_path_handler("^/(partial_results)", read_partial), json_path_handler("^/(partial_results)", read_partial),
json_path_handler("^/(reached_record_limit|reached_time_limit)", read_limit), json_path_handler("^/(reached_record_limit|reached_time_limit)", read_limit),
json_path_handler("^/(min_id|min_time_at|max_time_at|" json_path_handler("^/(min_id|min_time_at|max_time_at|"
"reached_beginning|reached_end|tail)") "reached_beginning|reached_end|tail|no_events)")
.add_cb(ignore_bool) .add_cb(ignore_bool)
.add_cb(ignore_str), .add_cb(ignore_str),
json_path_handler("^/events#/\\w+") json_path_handler("^/events#/\\w+")
@ -162,6 +162,8 @@ void papertrail_proc::yajl_writer(void *context, const char *str, size_t len)
long papertrail_proc::complete(CURLcode result) long papertrail_proc::complete(CURLcode result)
{ {
curl_request::complete(result);
yajl_reset(this->ptp_jhandle.in()); yajl_reset(this->ptp_jhandle.in());
if (result != CURLE_OK) { if (result != CURLE_OK) {
@ -172,6 +174,10 @@ long papertrail_proc::complete(CURLcode result)
return -1; return -1;
} }
if (this->ptp_max_time) {
return -1;
}
this->set_url(); this->set_url();
if (this->ptp_partial_read) { if (this->ptp_partial_read) {
this->ptp_partial_read = false; this->ptp_partial_read = false;