Skip to content

Commit

Permalink
when using local status file check for previous calcs don't exit with…
Browse files Browse the repository at this point in the history
… FAILURE case on file read error, simply ignore it and move on to calculating - the file will be created during that run
  • Loading branch information
chuckbergeron committed Nov 26, 2024
1 parent e9e12d2 commit 1ce6276
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/utils/compileWinners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,12 @@ export const readLocalFileStatusJson = (

const path = drawPath(chainId, prizePoolAddress, drawId);
const statusPath = `${localFileStatusPath}/${path}status.json`;
const fileJson = readFileSync(statusPath, "utf8");

if (!fileJson) {
console.warn("no status.json file?");
} else {
try {
const fileJson = readFileSync(statusPath, "utf8");
status = JSON.parse(fileJson);
} catch (e) {
console.warn(`Error reading file at ${statusPath}, likely does not exist yet`);
}

return status;
Expand Down

0 comments on commit 1ce6276

Please sign in to comment.