Skip to content

Commit

Permalink
do not block waiting for lock
Browse files Browse the repository at this point in the history
  • Loading branch information
boudra committed Apr 18, 2024
1 parent a1de209 commit b443196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"types": "dist/src/indexer/index.d.ts",
"scripts": {
"start": "node dist/src/index.js",
"dev": "sh -c 'tsx watch src/index.ts --http --indexer --http-wait-for-sync=false $@ | pino-pretty' --",
"dev": "sh -c 'tsx watch src/index.ts --http --indexer --http-wait-for-sync=true $@ | pino-pretty' --",
"build": "tsc",
"lint": "eslint src && prettier --check src",
"format": "prettier --write src",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async function main(): Promise<void> {
}

async function indexChains(isFirstRun = false) {
baseLogger.info("attempting to acquire write lock");
baseLogger.debug("attempting to acquire write lock");
const lock = await db.acquireWriteLock();

if (lock !== null) {
Expand Down Expand Up @@ -228,9 +228,9 @@ async function main(): Promise<void> {
return null;
}

await new Promise((r) => setTimeout(r, 5000));

return indexChains();
setTimeout(() => {
void indexChains();
}, 5000);
}

let indexChainsPromise;
Expand Down

0 comments on commit b443196

Please sign in to comment.