core: fix types

This commit is contained in:
undefined committed 2022-10-04 01:38:51 +08:00
1 parent d27a1499d2
commit 1c3dc161b6
13 files changed
+48 -62

No files matched your search

+1 -4
View File
@@ -2,7 +2,6 @@ import yaml from 'js-yaml';
import { nanoid } from 'nanoid';
import Schema from 'schemastery';
import { Logger } from './logger';
import * as bus from './service/bus';
import { NestKeys } from './typeutils';
const defaultPath = process.env.CI ? '/tmp/file'
@@ -64,7 +63,7 @@ export async function saveConfig(config: any) {
Schema.intersect(SystemSettings)(config);
const value = yaml.dump(config);
await global.Hydro.service.db.collection('system').updateOne({ _id: 'config' }, { $set: { value } }, { upsert: true });
bus.broadcast('config/update');
loadConfig();
}
export async function setConfig(key: string, value: any) {
const path = key.split('.');
@@ -109,5 +108,3 @@ export function requestConfig<T, S>(s: Schema<T, S>): {
const builtin = requestConfig(builtinSettings);
export const builtinConfig = builtin.config;
export const setBuiltinConfig = builtin.setConfig;
bus.on('config/update', loadConfig);