Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Load balance support#135

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
linglingye001 merged 2 commits intopreviewfromlinglingye/loadBalance
Nov 27, 2024
Merged

Load balance support#135

linglingye001 merged 2 commits intopreviewfromlinglingye/loadBalance
Nov 27, 2024

Conversation

@linglingye001
Copy link
Member

@linglingye001linglingye001 commentedNov 19, 2024
edited by zhiyuanliang-ms
Loading

A load balancing mode has been introduced, enabling your application to distribute requests to App Configuration across all available replicas.

Usage:

constappConfig=awaitload("YOUR-CONNECTION-STRING",{loadBalancingEnabled:true})

client:AppConfigurationClient;
backoffEndTime:number=0;// Timestamp
#failedAttempts:number=0;
failedAttempts:number=0;
Copy link
Member

@zhiyuanliang-mszhiyuanliang-msNov 22, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If you have to expose failedAttempt to be public for testing, you should make this private and create another public property which only has getter. And the getter will return the private #failedAttempt. This can make sure failedAttempt won't be modified outside of the class. And add comment to explain the purpose.

if(this.failedAttempts>0){
this.failedAttempts=0;
}
this.failedAttempts-=1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

failedAttempts can be negative. This doesn't make sense. If this behavior is only for testing, don't do that.

}
});
// one request for key values, one request for feature flags
expect(fakeClientWrapper_1.failedAttempts).eq(-1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Check thispattern. You can follow this pattern to verify how many times something is called. You can do whatever you want when you stub the fakeClientWrapper. You can set a local counter and when the client is called, counter += 1

@linglingye001linglingye001 merged commit2315e4c intopreviewNov 27, 2024
4 checks passed
@linglingye001linglingye001 deleted the linglingye/loadBalance branchNovember 27, 2024 06:58
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zhiyuanliang-mszhiyuanliang-mszhiyuanliang-ms approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@linglingye001@zhiyuanliang-ms

[8]ページ先頭

©2009-2025 Movatter.jp