You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-06-15 00:05:28 +02:00
improving config check and setting
This commit is contained in:
@ -14,7 +14,8 @@ export class ObjectManagerRepository {
|
||||
private static _instance: ObjectManagerRepository = null;
|
||||
|
||||
|
||||
public static InitMemoryManagers() {
|
||||
public static async InitMemoryManagers() {
|
||||
await ObjectManagerRepository.reset();
|
||||
const GalleryManager = require("./memory/GalleryManager").GalleryManager;
|
||||
const UserManager = require("./memory/UserManager").UserManager;
|
||||
const SearchManager = require("./memory/SearchManager").SearchManager;
|
||||
@ -26,6 +27,7 @@ export class ObjectManagerRepository {
|
||||
}
|
||||
|
||||
public static async InitMySQLManagers() {
|
||||
await ObjectManagerRepository.reset();
|
||||
await MySQLConnection.init();
|
||||
const GalleryManager = require("./mysql/GalleryManager").GalleryManager;
|
||||
const UserManager = require("./mysql/UserManager").UserManager;
|
||||
@ -45,7 +47,8 @@ export class ObjectManagerRepository {
|
||||
return this._instance;
|
||||
}
|
||||
|
||||
public static reset() {
|
||||
public static async reset() {
|
||||
await MySQLConnection.close();
|
||||
this._instance = null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user