Skip to content
New issue

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

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

Already on GitHub? # to your account

Make AltUnityClient connect maxTries dynamic #11

Open
bylihar opened this issue Oct 24, 2023 · 0 comments
Open

Make AltUnityClient connect maxTries dynamic #11

bylihar opened this issue Oct 24, 2023 · 0 comments

Comments

@bylihar
Copy link

bylihar commented Oct 24, 2023

Actually, the number of retries is hardcoded (equal to 15):

async connect() {
        let numTries = 0
        const maxTries = 15
        await retryInterval(maxTries, 1000, async () => {
            numTries++
            this.log.info(`Attempting to connect to AltUnity server. This is attempt ${numTries}/${maxTries}`)
            try {
                await this.conn.connect()
            } catch (err: any) {
                throw new Error(`Could not connect to the AltUnity server. Original error was: ${err.message}`)
            }
        })
        this.log.info(`Connection to AltUnity server established`)
    }

It might be very helpful to have it dynamic and pass using capability.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant