Skip to content

Commit

Permalink
fix: Added retry channel (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiakiteaneo authored Oct 11, 2023
2 parents e187295 + 554c674 commit 69edcdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ArmoniK.SDK.Client/src/ChannelPool.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ChannelPool.h"

#include <armonik/common/options/ControlPlane.h>
#include <armonik/common/utils/ChannelArguments.h>
#include <grpcpp/create_channel.h>
#include <utility>

Expand All @@ -27,14 +28,16 @@ std::shared_ptr<grpc::Channel> ChannelPool::AcquireChannel() {
return channel;
}
}

std::string endpoint(properties_.configuration.get_control_plane().getEndpoint());
auto scheme_delim = endpoint.find("://");
if (scheme_delim != std::string::npos) {
endpoint = endpoint.substr(scheme_delim + 3);
}
// TODO Handle TLS/mTLS
channel = grpc::CreateChannel(endpoint, grpc::InsecureChannelCredentials());
channel = grpc::CreateCustomChannel(
endpoint, grpc::InsecureChannelCredentials(),
armonik::api::common::utils::getChannelArguments(
static_cast<armonik::api::common::utils::Configuration>(properties_.configuration)));
logger_.log(armonik::api::common::logger::Level::Debug, "Created and acquired new channel from pool");
return channel;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

# shellcheck disable=SC2034
ARMONIK_API_VERSION_DEFAULT="3.13.1"
ARMONIK_API_VERSION_DEFAULT="3.13.2"
ARMONIK_SDK_VERSION_DEFAULT="0.1.0-local"

0 comments on commit 69edcdf

Please sign in to comment.