瀏覽代碼

fix: cfg funcs

Sven 1 年之前
父節點
當前提交
291b209bde
共有 1 個文件被更改,包括 5 次插入7 次删除
  1. 5 7
      src/config.ts

+ 5 - 7
src/config.ts

@@ -31,15 +31,13 @@ export function getFeatures() {
 }
 }
 
 
 /** Saves the feature config synchronously to the in-memory cache and asynchronously to the persistent storage */
 /** Saves the feature config synchronously to the in-memory cache and asynchronously to the persistent storage */
-export function saveFeatures(featureConf: FeatureConfig) {
-  const newData = cfgMgr.setData(featureConf);
-  info("Saved new feature config:", newData);
-  return newData;
+export async function saveFeatures(featureConf: FeatureConfig) {
+  await cfgMgr.setData(featureConf);
+  info("Saved new feature config:", featureConf);
 }
 }
 
 
 /** Saves the default feature config synchronously to the in-memory cache and asynchronously to persistent storage */
 /** Saves the default feature config synchronously to the in-memory cache and asynchronously to persistent storage */
-export function setDefaultFeatures() {
-  const defaultData = cfgMgr.saveDefaultData();
+export async function setDefaultFeatures() {
+  await cfgMgr.saveDefaultData();
   info("Reset feature config to its default value");
   info("Reset feature config to its default value");
-  return defaultData;
 }
 }