2020-07-11 11:46:16 +02:00
|
|
|
import {Express} from "express";
|
2021-05-03 19:29:22 +02:00
|
|
|
|
|
|
|
import ApplicationComponent from "../ApplicationComponent.js";
|
|
|
|
import MysqlConnectionManager from "../db/MysqlConnectionManager.js";
|
2020-04-22 15:52:17 +02:00
|
|
|
|
2020-09-25 22:03:22 +02:00
|
|
|
export default class MysqlComponent extends ApplicationComponent {
|
2020-09-25 23:42:15 +02:00
|
|
|
public async start(_app: Express): Promise<void> {
|
2020-04-22 15:52:17 +02:00
|
|
|
await this.prepare('Mysql connection', () => MysqlConnectionManager.prepare());
|
|
|
|
}
|
|
|
|
|
|
|
|
public async stop(): Promise<void> {
|
|
|
|
await MysqlConnectionManager.endPool();
|
|
|
|
}
|
|
|
|
|
2021-05-13 16:26:27 +02:00
|
|
|
public isReady(): boolean {
|
2020-09-25 22:03:22 +02:00
|
|
|
return MysqlConnectionManager.isReady();
|
2020-04-22 15:52:17 +02:00
|
|
|
}
|
|
|
|
|
2020-09-25 23:42:15 +02:00
|
|
|
}
|