Skip to content

Commit

Permalink
Merge branch 'main' into kjs/in-mem
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Jun 11, 2024
2 parents 86451ab + b932405 commit 1f0fb11
Show file tree
Hide file tree
Showing 14 changed files with 910 additions and 619 deletions.
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ponder/core

## 0.4.36

### Patch Changes

- [#931](https://github.com/ponder-sh/ponder/pull/931) [`3bf69809b25c7d3e50be6eaf2f8d3564c7bb8f14`](https://github.com/ponder-sh/ponder/commit/3bf69809b25c7d3e50be6eaf2f8d3564c7bb8f14) Thanks [@kyscott18](https://github.com/kyscott18)! - Fixed bug with cache intervals occasionally causing statement timeouts for large apps.

## 0.4.35

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ponder/core",
"version": "0.4.35",
"version": "0.4.36",
"description": "An open-source framework for crypto application backends",
"license": "MIT",
"type": "module",
Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/_test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ export async function setupDatabaseServices(

await database.migrateSyncStore();

const syncStore = new SqliteSyncStore({ db: database.syncDb });
const syncStore = new SqliteSyncStore({
db: database.syncDb,
common: context.common,
});

const indexingStore = {
...getReadonlyStore({
Expand Down Expand Up @@ -209,7 +212,10 @@ export async function setupDatabaseServices(

await database.migrateSyncStore();

const syncStore = new PostgresSyncStore({ db: database.syncDb });
const syncStore = new PostgresSyncStore({
db: database.syncDb,
common: context.common,
});

const indexingStore = {
...getReadonlyStore({
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/bin/utils/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export async function run({
.setup({ schema, buildId })
.then(({ namespaceInfo, checkpoint }) => [namespaceInfo, checkpoint]);

syncStore = new SqliteSyncStore({ db: database.syncDb });
syncStore = new SqliteSyncStore({ db: database.syncDb, common });
} else {
const { poolConfig, schema: userNamespace, publishSchema } = databaseConfig;
database = new PostgresDatabaseService({
Expand All @@ -91,7 +91,7 @@ export async function run({
.setup({ schema, buildId })
.then(({ namespaceInfo, checkpoint }) => [namespaceInfo, checkpoint]);

syncStore = new PostgresSyncStore({ db: database.syncDb });
syncStore = new PostgresSyncStore({ db: database.syncDb, common });
}

const readonlyStore = getReadonlyStore({
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/common/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export type Options = {
databaseHeartbeatTimeout: number;

indexingCacheBytes: number;

syncMaxIntervals: number;
};

export const buildOptions = ({ cliOptions }: { cliOptions: CliOptions }) => {
Expand Down Expand Up @@ -102,5 +104,7 @@ export const buildOptions = ({ cliOptions }: { cliOptions: CliOptions }) => {
databaseHeartbeatTimeout: 25 * 1000,

indexingCacheBytes: os.freemem() / 3,

syncMaxIntervals: 50_000,
} satisfies Options;
};
Loading

0 comments on commit 1f0fb11

Please sign in to comment.