Skip to content

feat: stats task added#29

Open
8bcb wants to merge 1 commit into
mainfrom
asiaziola/stats-task
Open

feat: stats task added#29
8bcb wants to merge 1 commit into
mainfrom
asiaziola/stats-task

Conversation

@8bcb

@8bcb 8bcb commented Jan 11, 2022

Copy link
Copy Markdown
Collaborator

No description provided.

@ppedziwiatr ppedziwiatr self-requested a review January 11, 2022 17:08
Comment thread src/db/schema.ts Outdated
table.bigInteger("block_height").notNullable().index();
table.string("block_id").notNullable();
table.string("timestamp").index();
table.jsonb("tags");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't tags be a separate table? I believe it could simplify future queries (I know that postgres has cool support for json, but still..)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, table should be named stats_contracts - and if we decide to move the tags to a separate one - stats_tags

Comment thread src/gateway/tasks/stats.ts Outdated

const currentNetworkHeight = results[1].value.height;

const lastProcessedBlockHeight = results[0].value?.block_height || 472808;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

472808 deserves its own constant ;-) to be used in syncTask

Comment thread src/gateway/tasks/stats.ts Outdated

}

async function loadPages(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should refactor this to some common function, that would be also used in the sync interactions task?

Comment thread src/gateway/tasks/stats.ts Outdated
ar
}
data {
size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size doesn't seem to be stored in the db...

@8bcb 8bcb force-pushed the asiaziola/stats-task branch from 1b3078a to d402442 Compare January 14, 2022 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants