[enh] add BMA watcher + reorganize code
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import {Conf} from './conf'
|
||||
import {Conf} from './types/conf'
|
||||
import * as yaml from 'js-yaml';
|
||||
import * as fs from 'fs';
|
||||
import {ws2pWatcher} from "./ws2p/ws2p-watcher";
|
||||
import {ws2pWatcher} from "./watchers/ws2p/ws2p-watcher";
|
||||
import {bmaWatcher} from "./watchers/bma/bma-watcher";
|
||||
|
||||
export async function dwatch(confFile: string) {
|
||||
|
||||
const yml = fs.readFileSync(confFile, 'utf8')
|
||||
const conf = yaml.load(yml) as Conf
|
||||
|
||||
await Promise.all(conf.ws2pServers.map(ws2pWatcher(conf)))
|
||||
await Promise.all((conf.ws2pServers || []).map(ws2pWatcher(conf)))
|
||||
await Promise.all((conf.bmaServers || []).map(bmaWatcher(conf)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user