diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-09 23:29:48 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-09 23:29:48 +0900 |
| commit | e3c0058942e81c55a62ae5f265bf0b653fcac65f (patch) | |
| tree | d7e124051a04dcaa8a0d2098a3ecc951658e6cb8 /src/init.ts | |
| parent | Update migrate.ts (diff) | |
| download | misskey-e3c0058942e81c55a62ae5f265bf0b653fcac65f.tar.gz misskey-e3c0058942e81c55a62ae5f265bf0b653fcac65f.tar.bz2 misskey-e3c0058942e81c55a62ae5f265bf0b653fcac65f.zip | |
Refactor
Diffstat (limited to 'src/init.ts')
| -rw-r--r-- | src/init.ts | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/init.ts b/src/init.ts index 69c117c140..3dcfc28b78 100644 --- a/src/init.ts +++ b/src/init.ts @@ -1,16 +1,10 @@ import { initDb } from './db/postgre'; -async function main() { - try { - console.log('Connecting database...'); - await initDb(false, true, true); - } catch (e) { - console.error('Cannot connect to database', null, true); - console.error(e); - process.exit(1); - } +console.log('Init database...'); +initDb(false, true, true).then(() => { console.log('Done :)'); -} - -main(); +}, e => { + console.error('Failed to init database'); + console.error(e); +}); |