Skip to content

update checker api call to not await #3748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions packages/common/src/allo/backends/allo-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,18 +780,29 @@ export class AlloV2 implements Allo {
blockNumber: receipt.blockNumber,
});

// sync pool with checker
await fetch("https://api.checker.gitcoin.co/api/pools", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
alloPoolId: args.roundId.toString(),
chainId: this.chainId,
skipEvaluation: false,
}),
});
try {
// Trigger the call to sync pool with checker API without awaiting the result.
// We don't await here because it's not necessary to block execution or handle the response.
// This also prevents checker API failures from impacting the rest of the code.
fetch("https://api.checker.gitcoin.co/api/pools", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
alloPoolId: args.roundId.toString(),
chainId: this.chainId,
skipEvaluation: false,
}),
}).catch((error) => {
console.error("Checker API call failed:", error);
});
} catch (error) {
console.error(
"Unexpected error while triggering checker API call:",
error
);
}

emit("indexingStatus", success(null));

Expand Down
Loading