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

Every new request opens new connection #570

Closed
technic opened this issue Sep 22, 2023 · 8 comments
Closed

Every new request opens new connection #570

technic opened this issue Sep 22, 2023 · 8 comments

Comments

@technic
Copy link

technic commented Sep 22, 2023

This is supper inefficient. Please fix. We already have api object in the code with corresponding requests methods, so connection can be stored in the object.

Upd:
With some monkey patching it can be fixed like this:

class ApiFactory {
    rest: rm.RestClient

    constructor(public uri: string, private token: string) {
        this.rest = new rm.RestClient('test', uri, [new BasicCredentialHandler('', this.token)], {keepAlive: true, maxSockets:1 })
    }

    createApi<T extends ClientApiBase>(f: new (string, [IRequestHandler]) => T) {
        const apiClinet = new f(this.uri, [getPersonalAccessTokenHandler(this.token)])
        apiClinet.rest = this.rest
        apiClinet.vsoClient.restClient = this.rest
        return apiClinet
    }
}

This way it works reliable and fast, without hitting azure DevOps rate-limiters due to multiple connections.

Copy link

This issue has had no activity in 90 days. Please comment if it is not actually stale

@github-actions github-actions bot added the stale label Dec 31, 2023
@technic
Copy link
Author

technic commented Jan 1, 2024

bump

@github-actions github-actions bot removed the stale label Jan 1, 2024
@szwalkowski
Copy link

Bump

Copy link

github-actions bot commented Jun 2, 2024

This issue has had no activity in 90 days. Please comment if it is not actually stale

@github-actions github-actions bot added the stale label Jun 2, 2024
@zkbule
Copy link

zkbule commented Jun 3, 2024

This issue has had no activity in 90 days. Please comment if it is not actually stale

not stale

@github-actions github-actions bot removed the stale label Jun 4, 2024
Copy link

github-actions bot commented Sep 2, 2024

This issue has had no activity in 90 days. Please comment if it is not actually stale

@github-actions github-actions bot added the stale label Sep 2, 2024
@github-actions github-actions bot closed this as completed Sep 9, 2024
@technic
Copy link
Author

technic commented Sep 9, 2024

Not fixed stupid bot

@technic
Copy link
Author

technic commented Sep 9, 2024

Are you closing every issue which you cant implement within 90 days? Are you kidding me? Please fix it, with this huge performance penalty these api bindings are useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants