R
RunPod7mo ago
fireice

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
nerdylive
nerdylive7mo ago
What's the url you're using? Oh I think it's js or ts problem?
digigoblin
digigoblin7mo ago
I don't think the JS SDK has been officially released yet, probably stll a work-in-progress.
fireice
fireiceOP7mo 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
digigoblin7mo ago
This is a terrible idea. NEVER put an API key in a frontend application.
fireice
fireiceOP7mo 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
fireiceOP7mo ago
const runpod = runpodSdk(RUNPOD_API_KEY); in my api , in server
digigoblin
digigoblin7mo 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
fireiceOP7mo ago
My RUNPOD_API_KEY in my server, api route, in .env file , not frontend
nerdylive
nerdylive7mo ago
Maybe delete the number = 3000 and see if it works The assignment
fireice
fireiceOP7mo ago
just now,I set default number 3000 to 300000, not work,still expeed 3000
digigoblin
digigoblin7mo ago
Log an issue on the SDK Github repo if its an issue with the SDK.
fireice
fireiceOP7mo 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.
Want results from more Discord servers?
Add your server