Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sample optimisticConcurrencyViaEtag #9451

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ export async function main() {
// they'll have to coordinate this. This is when they use the etag.

// For our example we'll have Beta update first
betaSetting.value = "Beta has updated the value"
const betaUpdatedSetting = await client.setConfigurationSetting(
{
key: key,
value: "Beta has updated the value"
},
betaSetting,
{
// onlyIfUnchanged allows Beta to say "only update the setting if the _current_ etag matches my etag"
// which is true for Beta since nobody has modified it since Beta got it.
Expand All @@ -68,11 +66,9 @@ export async function main() {
);

try {
alphaSetting.value = "Alpha is attempting to update the value but will fail";
await client.setConfigurationSetting(
{
key: key,
value: "Alpha is attempting to update the value but will fail"
},
alphaSetting,
{
// in this case Alpha's etag is out of date - there's no way to update it
// without retrieving the setting again. This allows Alpha a chance to
Expand Down