mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-02-12 05:55:16 -05:00
We had a report of one user on modern MacBook with 16GB of memory who was running into heap allocation issues. This was likely due to the excessive number of promises we were creating (as well as buffering all data for each call). Change the logic to fetch in batches of 1K records at most. This slows down the initial sync but should reduce the likelihood that someone will hit a memory limit. We also specify a custom limit in the `yarn start` command so that when we test locally we are using the same limit as everyone else.
23 lines
504 B
JSON
23 lines
504 B
JSON
{
|
|
"name": "example-replicate-data-postgres",
|
|
"private": true,
|
|
"type": "module",
|
|
"version": "0.0.0",
|
|
"main": "index.ts",
|
|
"scripts": {
|
|
"start": "NODE_OPTIONS=--max-old-space-size=1024 tsx index.ts"
|
|
},
|
|
"dependencies": {
|
|
"@farcaster/hub-nodejs": "^0.7.1",
|
|
"kysely": "^0.24.2",
|
|
"kysely-postgres-js": "^1.1.1",
|
|
"pino": "^8.12.1",
|
|
"postgres": "^3.3.4",
|
|
"tiny-typed-emitter": "^2.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"tsx": "^3.12.5",
|
|
"typescript": "^5.0.0"
|
|
}
|
|
}
|