Commit e2fb4cbf authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 7b146e4f 0001e155
Pipeline #1251 passed with stages
in 13 minutes and 22 seconds
......@@ -23,6 +23,9 @@ class DataManager {
this.ready = false;
this.log = log;
}
async finalize() {
await this.db.close();
}
async transaction(fun) {
const runner = await this.db.createQueryRunner();
await runner.connect();
......
......@@ -46,6 +46,9 @@ export class DataManager {
this.ready = false;
this.log = log;
}
async finalize() {
await this.db.close();
}
private async transaction(fun: (mdb: EntityManager) => Promise<boolean>) {
const runner = await this.db.createQueryRunner();
await runner.connect();
......
......@@ -4211,3 +4211,7 @@ if true
return
init()
process.on 'SIGINT', ()->
if this.dataManager
await this.dataManager.finialize()
process.exit(0)
\ No newline at end of file
......@@ -5594,4 +5594,11 @@
init();
process.on('SIGINT', async function() {
if (this.dataManager) {
await this.dataManager.finialize();
return process.exit(0);
}
});
}).call(this);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment