This commit is contained in:
Siddharth Singh 2024-07-01 21:43:01 +05:30
parent 98aaab8e51
commit 65f77e845d
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View file

@ -2,8 +2,8 @@ import { DittoDB } from '@/db/DittoDB.ts';
import { delay } from '@/test.ts';
if (Deno.env.get('CI') && Deno.env.get('DATABASE_URL')?.startsWith('postgres')) {
console.info('Waiting 15 seconds for postgres to start...');
await delay(15000);
console.info('Waiting 15 seconds for postgres to start...');
await delay(15000);
}
const kysely = await DittoDB.getInstance();

View file

@ -1,5 +1,5 @@
import { Kysely } from 'kysely';
import { PostgresJSDialect } from "kysely-postgres-js";
import { PostgresJSDialect } from 'kysely-postgres-js';
import postgres from 'postgres';
import { Conf } from '@/config.ts';
@ -14,9 +14,9 @@ export class DittoPostgres {
if (!this.db) {
this.db = new Kysely({
dialect: new PostgresJSDialect({
postgres: postgres(Conf.databaseUrl) as any
postgres: postgres(Conf.databaseUrl) as any,
}),
log: KyselyLogger
log: KyselyLogger,
});
}

View file

@ -63,4 +63,4 @@ export async function getTestDB() {
};
}
export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));