Fix ExecuteOnWorkers

Reviewers: florijan

Reviewed By: florijan

Differential Revision: https://phabricator.memgraph.io/D1132
This commit is contained in:
Dominik Gleich 2018-01-23 11:28:03 +01:00
parent 5a698444bf
commit 5ad39a8735

View File

@ -56,8 +56,10 @@ class RpcWorkerClients {
std::vector<std::future<TResult>> futures;
for (auto &client : clients_) {
if (client.first == skip_worker_id) continue;
futures.emplace_back(
std::async(std::launch::async, execute(client.second)));
std::async(std::launch::async,
[&execute, &client]() { return execute(client.second); }));
}
return futures;
}