mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-17 12:24:24 +01:00
waitReady is not actually needed
This commit is contained in:
@@ -6,7 +6,6 @@ export interface DittoDatabase {
|
||||
readonly kysely: Kysely<DittoTables>;
|
||||
readonly poolSize: number;
|
||||
readonly availableConnections: number;
|
||||
readonly waitReady: Promise<void>;
|
||||
}
|
||||
|
||||
export interface DittoDatabaseOpts {
|
||||
|
||||
@@ -21,7 +21,6 @@ export class DittoPglite {
|
||||
kysely,
|
||||
poolSize: 1,
|
||||
availableConnections: 1,
|
||||
waitReady: pglite.waitReady,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ export class DittoPostgres {
|
||||
get availableConnections() {
|
||||
return pg.connections.idle;
|
||||
},
|
||||
waitReady: Promise.resolve(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ export class Storages {
|
||||
if (!this._database) {
|
||||
this._database = (async () => {
|
||||
const db = DittoDB.create(Conf.databaseUrl, { poolSize: Conf.pg.poolSize });
|
||||
await db.waitReady;
|
||||
await DittoDB.migrate(db.kysely);
|
||||
return db;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user