mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-28 17:50:28 +08:00
Handle subgraph API quota exhaustion
We had to improve the logic when the subgraph API quota has been exhausted. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
+13
-5
@@ -203,16 +203,24 @@ export class Org {
|
||||
GetSafesByOwners,
|
||||
{ owners: [owner] },
|
||||
);
|
||||
const safes = safesByOwner.safes.reduce(
|
||||
(prev: any, curr: Safe) => prev.concat(curr.id),
|
||||
[],
|
||||
);
|
||||
|
||||
let safes = [];
|
||||
if (safesByOwner && safesByOwner.safes.length > 0) {
|
||||
safes = safesByOwner.safes.reduce(
|
||||
(prev: any, curr: Safe) => prev.concat(curr.id),
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
const orgsByOwner = await utils.querySubgraph(
|
||||
config.orgs.subgraph,
|
||||
GetOrgsByOwners,
|
||||
{ owners: [...safes, owner] },
|
||||
);
|
||||
const orgs: { id: string; owner: string }[] = [...orgsByOwner.orgs];
|
||||
let orgs: { id: string; owner: string }[] = [];
|
||||
if (orgsByOwner && orgsByOwner.orgs) {
|
||||
orgs = [...orgsByOwner.orgs];
|
||||
}
|
||||
|
||||
return orgs.map(o => new Org(o.id, o.owner));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user