diff options
Diffstat (limited to 'src/mongo/s/commands/kill_sessions_remote.cpp')
-rw-r--r-- | src/mongo/s/commands/kill_sessions_remote.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/s/commands/kill_sessions_remote.cpp b/src/mongo/s/commands/kill_sessions_remote.cpp index d9b5ce26ccf..0102de0d580 100644 --- a/src/mongo/s/commands/kill_sessions_remote.cpp +++ b/src/mongo/s/commands/kill_sessions_remote.cpp @@ -119,9 +119,11 @@ SessionKiller::Result killSessionsRemote(OperationContext* opCtx, // Generate the kill command. KillAllSessionsByPatternCmd cmd; - cmd.setKillAllSessionsByPattern(std::vector<KillAllSessionsByPattern>{ - matcher.getPatterns().begin(), matcher.getPatterns().end()}); - + std::vector<KillAllSessionsByPattern> patterns{matcher.getPatterns().size()}; + for (auto& item : matcher.getPatterns()) { + patterns.push_back(std::move(item.pattern)); + } + cmd.setKillAllSessionsByPattern(std::move(patterns)); return parallelExec(opCtx, cmd.toBSON(), urbg); } |