Skip to content

Commit

Permalink
Update replica example to use SDK with the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej committed Jun 26, 2024
1 parent fbb2e95 commit 8be5649
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,7 @@ jobs:
filepath = os.path.join(root, file)
if os.access(filepath, os.X_OK) or filepath.endswith('.exe'):
print(f"##[group]{filepath}", file=sys.stderr)
subprocess.run(filepath)
result = subprocess.run(filepath)
print("##[endgroup]", file=sys.stderr)
if result.returncode != 0:
sys.exit(result.returncode)
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cpmaddpackage(
NAME
couchbase_cxx_client
GIT_TAG
76c30a927e81f8cc58f00c1cdba2f996c8c24385
0a172faa29cecb22a8774a49dd22748901d4f2d2
VERSION
1.0.0
GITHUB_REPOSITORY
Expand Down
6 changes: 4 additions & 2 deletions examples/transactions_transfer_read_replica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ main()
std::cout << "Unable to read account for Alice from preferred group \""
<< preferred_server_group << "\": " << e1.ec().message()
<< ". Falling back to regular get\n";
auto [e2, alice] = ctx->get(collection, "alice");
auto [e2, alice_fallback] = ctx->get(collection, "alice");
if (e2.ec()) {
std::cout << "Unable to read account for Alice: " << e2.ec().message() << "\n";
return e2;
}
alice = alice_fallback;
}
auto alice_content = alice.content_as<bank_account>();

Expand All @@ -172,11 +173,12 @@ main()
std::cout << "Unable to read account for Bob from preferred group \""
<< preferred_server_group << "\": " << e3.ec().message()
<< ". Falling back to regular get\n";
auto [e4, alice] = ctx->get(collection, "alice");
auto [e4, bob_fallback] = ctx->get(collection, "bob");
if (e4.ec()) {
std::cout << "Unable to read account for Alice: " << e4.ec().message() << "\n";
return e4;
}
bob = bob_fallback;
}
auto bob_content = bob.content_as<bank_account>();

Expand Down

0 comments on commit 8be5649

Please sign in to comment.