-
Notifications
You must be signed in to change notification settings - Fork 9
feat: stats task added #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/db/schema.ts
Outdated
| table.bigInteger("block_height").notNullable().index(); | ||
| table.string("block_id").notNullable(); | ||
| table.string("timestamp").index(); | ||
| table.jsonb("tags"); |
There was a problem hiding this comment.
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..)
There was a problem hiding this comment.
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
src/gateway/tasks/stats.ts
Outdated
|
|
||
| const currentNetworkHeight = results[1].value.height; | ||
|
|
||
| const lastProcessedBlockHeight = results[0].value?.block_height || 472808; |
There was a problem hiding this comment.
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
src/gateway/tasks/stats.ts
Outdated
|
|
||
| } | ||
|
|
||
| async function loadPages( |
There was a problem hiding this comment.
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?
src/gateway/tasks/stats.ts
Outdated
| ar | ||
| } | ||
| data { | ||
| size |
There was a problem hiding this comment.
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...
1b3078a to
d402442
Compare
d402442 to
4a30319
Compare
No description provided.