Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiakiteaneo committed Feb 27, 2024
1 parent 611f656 commit 7a4d6c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ArmoniK.SDK.Client/src/SessionServiceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void SessionServiceImpl::CleanupTasks(const std::set<std::string> &task_ids) {
channel_pool.WithChannel([&](const std::shared_ptr<::grpc::Channel> &channel) {
std::vector<std::string> batched_ids;
for (size_t i = 0; i < batch_size && tasks_iterator != task_ids.end(); ++i) {
batched_ids.emplace_back(*tasks_iterator);
batched_ids.push_back(*tasks_iterator);
tasks_iterator++;
}
armonik::api::client::TasksClient(armonik::api::grpc::v1::tasks::Tasks::NewStub(channel))
Expand All @@ -318,7 +318,7 @@ void SessionServiceImpl::CleanupTasks(const std::set<std::string> &task_ids) {
auto map_results = channel_pool.WithChannel([&](const std::shared_ptr<::grpc::Channel> &channel) {
std::vector<std::string> batched_ids;
for (size_t i = 0; i < batch_size && tasks_iterator != task_ids.end(); ++i) {
batched_ids.emplace_back(*tasks_iterator);
batched_ids.push_back(*tasks_iterator);
tasks_iterator++;
}
return armonik::api::client::TasksClient(armonik::api::grpc::v1::tasks::Tasks::NewStub(channel))
Expand All @@ -331,7 +331,8 @@ void SessionServiceImpl::CleanupTasks(const std::set<std::string> &task_ids) {
std::vector<std::string> resultIds;
resultIds.reserve(map_results.size());
for (auto &&taskId_resultIds : map_results) {
resultIds.insert(resultIds.end(), taskId_resultIds.second.begin(), taskId_resultIds.second.end());
resultIds.insert(resultIds.end(), std::make_move_iterator(taskId_resultIds.second.begin()),
std::make_move_iterator(taskId_resultIds.second.end()));
}
results.delete_results_data(session, resultIds);
});
Expand Down

0 comments on commit 7a4d6c2

Please sign in to comment.