#timeout in javascript sdk not work

15 messages · Page 1 of 1 (latest)

small torrent
#

const runRequest = await endpoint.run(inputPayload, 600000);
An error occurred: AxiosError: timeout of 3000ms exceeded.
It seems that the timeout setting is not taking effect.

this is the run function in js sdk.
async run(
request: EndpointInputPayload,
timeout: number = 3000
): Promise<EndpointIncompleteOutput> {
return run(this.baseUrl, this.apiKey, this.endpointId, request, timeout)
}

tribal lava
#

What's the url you're using?

#

Oh I think it's js or ts problem?

wild dust
#

I don't think the JS SDK has been officially released yet, probably stll a work-in-progress.

small torrent
#

I use runpod javascript sdk in next.js project, const { RUNPOD_API_KEY, ENDPOINT_ID } = process.env;

    const runpod = runpodSdk(RUNPOD_API_KEY);
    const endpoint = runpod.endpoint(ENDPOINT_ID);

    const runRequest = await endpoint.run(inputPayload, 600000);
wild dust
#

This is a terrible idea. NEVER put an API key in a frontend application.

small torrent
#

const runpod = runpodSdk(RUNPOD_API_KEY);
in my api , in server

wild dust
#

That documentation assumes backend not frontend. I think @fringe yarrow needs to put a warning on that doc otherwise people are going to have their API keys leaked.

small torrent
#

My RUNPOD_API_KEY in my server, api route, in .env file , not frontend

tribal lava
#

The assignment

small torrent
#

just now,I set default number 3000 to 300000, not work,still expeed 3000

wild dust
#

Log an issue on the SDK Github repo if its an issue with the SDK.

small torrent