Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ folly::SemiFuture<std::unique_ptr<HttpResponse>> HttpClient::sendRequest(
sendRequest(std::move(responseHandler));
};

if (delayMs > 0) {
if (delayMs > 0 && eventBase_ != nullptr) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else condition uses eventBase_ as well. We should make sure life time of event base be equal or longer than client.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you are spot on! Let me fix it.

// schedule() is expected to be run in the event base thread
eventBase_->runInEventBaseThread([=]() {
eventBase_->schedule(sendCb, std::chrono::milliseconds(delayMs));
Expand Down