Pinata-SDK: Method pinList throws error after multiple sequential calls
Hello,
I’m using pinata service(professional with 100GB bandwidth) as my database. I am pinning bunch of Json for each of my assets as: assetId: “t-0” , assetId: “t-1” etc. Then I’ll get their cid’s with
try {
res = await pinata.pinList({
metadata: {
keyvalues: {
assetId: {
value: `t-${asset_id}`,
op: "eq",
},
},
},
});
} catch (error) {
console.error("pinList error: ", error.toString());
throw error;
}
as specified in docs. Then I use the retrieved cid to get json content from “js-ipfs” library to avoid making extra requests to pinata gateway. However, after 6-7 consequent successful requests pinata.pinList throws me this error:
pinList error: Error: [object Object]
Error: [object Object]
at <PATH>\node_modules\@pinata\sdk\lib\pinata-sdk.js:22176:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I believe this behavior will block me from getting in live version. Any workaround ideas will be appreciated.
Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (8 by maintainers)
Thanks for trying that. I have a fix for the bad error response on the SDK that I’ll be sending up soon. In the mean time, we need to figure out why you’re getting rate-limited. To help keep the github repo clean, would you be ok if we move this to email or slack?
The bug here, IMO, is the error response on the SDK. So I’ll close this issue when that’s released. But we do want to help you figure out the rate-limiting.