Skip to content

Commit f07670c

Browse files
authored
update checker api call to not await (#3748)
1 parent 964701b commit f07670c

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

packages/common/src/allo/backends/allo-v2.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -780,18 +780,29 @@ export class AlloV2 implements Allo {
780780
blockNumber: receipt.blockNumber,
781781
});
782782

783-
// sync pool with checker
784-
await fetch("https://api.checker.gitcoin.co/api/pools", {
785-
method: "POST",
786-
headers: {
787-
"Content-Type": "application/json",
788-
},
789-
body: JSON.stringify({
790-
alloPoolId: args.roundId.toString(),
791-
chainId: this.chainId,
792-
skipEvaluation: false,
793-
}),
794-
});
783+
try {
784+
// Trigger the call to sync pool with checker API without awaiting the result.
785+
// We don't await here because it's not necessary to block execution or handle the response.
786+
// This also prevents checker API failures from impacting the rest of the code.
787+
fetch("https://api.checker.gitcoin.co/api/pools", {
788+
method: "POST",
789+
headers: {
790+
"Content-Type": "application/json",
791+
},
792+
body: JSON.stringify({
793+
alloPoolId: args.roundId.toString(),
794+
chainId: this.chainId,
795+
skipEvaluation: false,
796+
}),
797+
}).catch((error) => {
798+
console.error("Checker API call failed:", error);
799+
});
800+
} catch (error) {
801+
console.error(
802+
"Unexpected error while triggering checker API call:",
803+
error
804+
);
805+
}
795806

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

0 commit comments

Comments
 (0)