timeout in javascript sdk not work

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) }
12 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin2y ago
I don't think the JS SDK has been officially released yet, probably stll a work-in-progress.
fireice
fireiceOP2y ago
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);
digigoblin
digigoblin2y ago
This is a terrible idea. NEVER put an API key in a frontend application.
fireice
fireiceOP2y ago
https://docs.runpod.io/sdks/javascript/endpoints Following the documentation, apply this sentence.
Endpoints | RunPod Documentation
Learn how to interact with RunPod's endpoints using the JavaScript SDK, including synchronous and asynchronous execution methods, status checks, and job cancellation. Discover how to set timeouts, execute policies, and purge queues.
fireice
fireiceOP2y ago
const runpod = runpodSdk(RUNPOD_API_KEY); in my api , in server
digigoblin
digigoblin2y ago
That documentation assumes backend not frontend. I think @PatrickR needs to put a warning on that doc otherwise people are going to have their API keys leaked.
fireice
fireiceOP2y ago
My RUNPOD_API_KEY in my server, api route, in .env file , not frontend
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
fireice
fireiceOP2y ago
just now,I set default number 3000 to 300000, not work,still expeed 3000
digigoblin
digigoblin2y ago
Log an issue on the SDK Github repo if its an issue with the SDK.
fireice
fireiceOP2y ago
I see, in index.ts, import { curry, clamp, isNil } from "ramda",but I did not install ramda before. So run = curry () did not work.Now I works.

Did you find this page helpful?