diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2021-09-03 19:11:40 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-08 07:54:48 +0000 |
commit | c90f38192378c8526354465991830524eda90c1f (patch) | |
tree | 73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/client | |
parent | a0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff) | |
download | mongo-c90f38192378c8526354465991830524eda90c1f.tar.gz |
SERVER-59782 migrate makeGuard calls to ScopeGuard
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/dbclient_connection.cpp | 6 | ||||
-rw-r--r-- | src/mongo/client/fetcher.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp index 9770437645b..48b7977992c 100644 --- a/src/mongo/client/dbclient_connection.cpp +++ b/src/mongo/client/dbclient_connection.cpp @@ -704,7 +704,7 @@ DBClientConnection::DBClientConnection(bool _autoReconnect, void DBClientConnection::say(Message& toSend, bool isRetry, string* actualServer) { checkConnection(); - auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); }); + ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); }); toSend.header().setId(nextMessageId()); toSend.header().setResponseToMsgId(0); @@ -723,7 +723,7 @@ void DBClientConnection::say(Message& toSend, bool isRetry, string* actualServer } Status DBClientConnection::recv(Message& m, int lastRequestId) { - auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); }); + ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); }); auto swm = _session->sourceMessage(); if (!swm.isOK()) { return swm.getStatus(); @@ -747,7 +747,7 @@ bool DBClientConnection::call(Message& toSend, bool assertOk, string* actualServer) { checkConnection(); - auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); }); + ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); }); auto maybeThrow = [&](const auto& errStatus) { if (assertOk) uassertStatusOKWithContext(errStatus, diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp index 4dc580c5d12..75cbf7f1d0d 100644 --- a/src/mongo/client/fetcher.cpp +++ b/src/mongo/client/fetcher.cpp @@ -339,7 +339,7 @@ Status Fetcher::_scheduleGetMore(const BSONObj& cmdObj) { void Fetcher::_callback(const RemoteCommandCallbackArgs& rcbd, const char* batchFieldName) { QueryResponse batchData; - auto finishCallbackGuard = makeGuard([this, &batchData] { + ScopeGuard finishCallbackGuard([this, &batchData] { if (batchData.cursorId && !batchData.nss.isEmpty()) { _sendKillCursors(batchData.cursorId, batchData.nss); } |