Skip to content

Commit

Permalink
Fix http sink metric bug (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
Takuka0311 authored Jan 10, 2025
1 parent 087489d commit c5ef21f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/runner/sink/http/HttpSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ bool HttpSink::AddRequestToClient(unique_ptr<HttpSinkRequest>&& request) {

request->mPrivateData = headers;
curl_easy_setopt(curl, CURLOPT_PRIVATE, request.get());
request->mLastSendTime = chrono::system_clock::now();

auto res = curl_multi_add_handle(mClient, curl);
if (res != CURLM_OK) {
Expand Down Expand Up @@ -291,6 +292,7 @@ void HttpSink::HandleCompletedRequests(int& runningHandlers) {
++request->mTryCnt;
AddRequestToClient(unique_ptr<HttpSinkRequest>(request));
++runningHandlers;
mSendingItemsTotal->Add(1);
requestReused = true;
} else {
auto errMsg = curl_easy_strerror(msg->data.result);
Expand Down

0 comments on commit c5ef21f

Please sign in to comment.