Skip to content

Commit

Permalink
Fix: Provide initial last block value when creating stats in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubcolony committed Jan 31, 2024
1 parent 0413a1c commit 551c616
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ export const initStats = async (): Promise<void> => {
?.data?.getIngestorStats ?? {};

if (!jsonStats) {
stats = {
lastBlockNumber: 1,
};

await mutate<CreateStatsMutation, CreateStatsMutationVariables>(
CreateStatsDocument,
{
value: JSON.stringify({}),
value: JSON.stringify(stats),
},
);
} else {
Expand Down

0 comments on commit 551c616

Please sign in to comment.