Skip to content

Commit

Permalink
Merge pull request #15 from yuki-wtf/remove-wait
Browse files Browse the repository at this point in the history
Remove wait in indexer && remove any transactions older than 15 min
  • Loading branch information
lorcan-codes authored Feb 14, 2024
2 parents 8b1d185 + 7d10f7c commit 737f75a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions indexer/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const updateTransactions = async () => {
limit 1
) IS NOT NULL
OR
(t.status = 'REJECTED' AND t."createdAt" < (now() - interval '15 minutes'))
t."createdAt" < (now() - interval '15 minutes')
returning hash;
`)

Expand Down Expand Up @@ -290,7 +290,7 @@ const updatePendingMints = async () => {
}
};

const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
// const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
export const indexer = async () => {
await checkWhitelistProofs();
try {
Expand All @@ -299,7 +299,6 @@ export const indexer = async () => {
await viewRefresher();
await updateTransactions();
await updatePendingMints();
await wait(3000);
}
} catch (e) {
if (e instanceof Error && e.message.includes("BLOCK_NOT_FOUND")) {
Expand Down

0 comments on commit 737f75a

Please sign in to comment.