mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
Fix archive util config reload
This commit is contained in:
parent
469c08b0f2
commit
5bb4f9b903
3 changed files with 18 additions and 8 deletions
|
@ -6,6 +6,7 @@ const Config = require('./config.js').get;
|
|||
const stringFormat = require('./string_format.js');
|
||||
const Errors = require('./enig_error.js').Errors;
|
||||
const resolveMimeType = require('./mime_util.js').resolveMimeType;
|
||||
const Events = require('./events.js');
|
||||
|
||||
// base/modules
|
||||
const fs = require('graceful-fs');
|
||||
|
@ -58,9 +59,13 @@ module.exports = class ArchiveUtil {
|
|||
}
|
||||
|
||||
init() {
|
||||
//
|
||||
// Load configuration
|
||||
//
|
||||
this.reloadConfig();
|
||||
Events.on(Events.getSystemEvents().ConfigChanged, () => {
|
||||
this.reloadConfig();
|
||||
});
|
||||
}
|
||||
|
||||
reloadConfig() {
|
||||
const config = Config();
|
||||
if(_.has(config, 'archives.archivers')) {
|
||||
Object.keys(config.archives.archivers).forEach(archKey => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue