Skip to content

Commit

Permalink
Update client version (#1264)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Update python client to 0.2.0.dev3, and client index is updated to 2;

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
  • Loading branch information
JinHai-CN authored May 30, 2024
1 parent 67fdd71 commit 96f7cf5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/infinity/remote_thrift/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from infinity.remote_thrift.infinity_thrift_rpc import *
from infinity.remote_thrift.infinity_thrift_rpc.ttypes import *
from infinity.errors import ErrorCode

from infinity.common import InfinityException

class ThriftInfinityClient:
def __init__(self, uri: URI):
Expand All @@ -43,7 +43,10 @@ def reconnect(self):

# version: 0.2.0.dev2, client_version: 1
# version: 0.2.0.dev3, client_version: 2
res = self.client.Connect(ConnectRequest(client_version=1))
# version: 0.2.0.dev4, client_version: 3
res = self.client.Connect(ConnectRequest(client_version=2))
if res.error_code != 0:
raise InfinityException(res.error_code, res.error_msg)
self.session_id = res.session_id

def create_database(self, db_name: str, conflict_type: CreateConflict = CreateConflict.Error):
Expand Down
1 change: 1 addition & 0 deletions src/network/infinity_thrift_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace infinity {

ClientVersions::ClientVersions() {
client_version_map_[1] = String("0.2.0.dev2");
client_version_map_[2] = String("0.2.0.dev3");
}

Pair<const char*, Status> ClientVersions::GetVersionByIndex(i64 version_index) {
Expand Down
2 changes: 1 addition & 1 deletion src/network/infinity_thrift_service.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct ClientVersions {
export class InfinityThriftService final : public infinity_thrift_rpc::InfinityServiceIf {
private:
static constexpr std::string_view ErrorMsgHeader = "[THRIFT ERROR]";
static constexpr i64 current_version_index_{1};
static constexpr i64 current_version_index_{2}; // 0.2.0.dev3

static std::mutex infinity_session_map_mutex_;
static HashMap<u64, SharedPtr<Infinity>> infinity_session_map_;
Expand Down

0 comments on commit 96f7cf5

Please sign in to comment.