From 2bc6879661194e93320b7f24e4b9ba0ffd89d7c3 Mon Sep 17 00:00:00 2001 From: Max Hirschhorn Date: Thu, 10 Aug 2017 21:49:32 -0400 Subject: Revert "SERVER-29202 Add a refreshLogicalSessionCacheNow test command" This reverts commit e1978af38dff725f0a0a60bca39a21b072751218. --- src/mongo/db/logical_session_cache.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/mongo/db/logical_session_cache.cpp') diff --git a/src/mongo/db/logical_session_cache.cpp b/src/mongo/db/logical_session_cache.cpp index fb3518ada63..7baeb66593d 100644 --- a/src/mongo/db/logical_session_cache.cpp +++ b/src/mongo/db/logical_session_cache.cpp @@ -226,17 +226,8 @@ void LogicalSessionCache::_refresh(Client* client) { // failed to refresh, it means their authoritative records were removed, and // we should remove such records from our cache as well. { - boost::optional uniqueCtx; - auto* const opCtx = [&client, &uniqueCtx] { - if (client->getOperationContext()) { - return client->getOperationContext(); - } - - uniqueCtx.emplace(client->makeOperationContext()); - return uniqueCtx->get(); - }(); - - auto res = _sessionsColl->refreshSessions(opCtx, std::move(activeSessions), time); + auto opCtx = client->makeOperationContext(); + auto res = _sessionsColl->refreshSessions(opCtx.get(), std::move(activeSessions), time); if (!res.isOK()) { // TODO SERVER-29709: handle network errors here. return; -- cgit v1.2.1