Skip to content

Commit

Permalink
chore: return promise from cleanupWal
Browse files Browse the repository at this point in the history
We want to return a promise so callers can await on it if desired.
  • Loading branch information
djwhitt committed Sep 24, 2024
1 parent 51e3744 commit edf56d7
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/database/standalone-sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2973,25 +2973,27 @@ export class StandaloneSqliteDatabase
}

async cleanupWal(dbName: WorkerPoolName): Promise<void> {
this.queueWrite(dbName, 'cleanupWal', [dbName]).then((walCheckpoint) => {
this.log.info('WAL checkpoint', {
dbName,
walCheckpoint,
});
return this.queueWrite(dbName, 'cleanupWal', [dbName]).then(
(walCheckpoint) => {
this.log.info('WAL checkpoint', {
dbName,
walCheckpoint,
});

metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'busy' },
walCheckpoint.busy,
);
metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'log' },
walCheckpoint.log,
);
metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'checkpointed' },
walCheckpoint.checkpointed,
);
});
metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'busy' },
walCheckpoint.busy,
);
metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'log' },
walCheckpoint.log,
);
metrics.sqliteWalCheckpointPages.set(
{ db: dbName, type: 'checkpointed' },
walCheckpoint.checkpointed,
);
},
);
}
}

Expand Down

0 comments on commit edf56d7

Please sign in to comment.