Commit 2233b5c6 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot

Use RequestContextScopeGuard instead of RequestContext::setContext

Summary: RequestContext::setContext is only meant to be used internally.

Reviewed By: yfeldblum

Differential Revision: D13352499

fbshipit-source-id: 6837186a5eaf0e9ad53cead73c5957a17bbb82bd
parent ed66c39a
...@@ -1317,7 +1317,7 @@ TEST(FiberManager, RequestContext) { ...@@ -1317,7 +1317,7 @@ TEST(FiberManager, RequestContext) {
}); });
} }
{ {
folly::RequestContext::setContext(nullptr); folly::RequestContextScopeGuard rctx;
fm.addTask([&]() { fm.addTask([&]() {
folly::RequestContextScopeGuard rctx; folly::RequestContextScopeGuard rctx;
auto rcontext4 = folly::RequestContext::get(); auto rcontext4 = folly::RequestContext::get();
......
...@@ -54,7 +54,7 @@ TEST(Context, basic) { ...@@ -54,7 +54,7 @@ TEST(Context, basic) {
}); });
// Clear the context // Clear the context
RequestContext::setContext(nullptr); folly::RequestContextScopeGuard rctx2;
EXPECT_EQ(nullptr, RequestContext::get()->getContextData("test")); EXPECT_EQ(nullptr, RequestContext::get()->getContextData("test"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment