Fixed db bug
The DB was moved to a different file and was returning a reference of the DB. When uploading a new database the original variable containing the DB in the DB file was not updating. Added setters and getters.
This commit is contained in:
@@ -41,7 +41,7 @@ app.set("view engine", "ejs");
|
||||
app.set("views", path.join(__dirname, app_conf.views_directory));
|
||||
const server = app.listen(app_conf.port, () => {
|
||||
logger.info("Starting Database Editor.");
|
||||
|
||||
db.connect();
|
||||
fs.rm(path.join(__dirname, app_conf.temp_directory, "/."), { recursive: true }, (error) => {
|
||||
if (error == null) {
|
||||
logger.info("Removed temp directory.");
|
||||
@@ -73,7 +73,7 @@ function shutdown() {
|
||||
shutting_down = true;
|
||||
logger.info("Closing Database connection.");
|
||||
try {
|
||||
db.close();
|
||||
db.getDB().close();
|
||||
} catch (error) {
|
||||
logger.error(error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user