mm_cachebase 1.9.3 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -48,6 +48,7 @@ class CacheBase extends Base {
48
48
  this.is_inited = false;
49
49
  this.is_destroyed = false;
50
50
 
51
+ this.setConfig(config);
51
52
  // 初始化服务
52
53
  this.init();
53
54
  }
@@ -2367,7 +2368,7 @@ function cachebaseAdmin(scope, config) {
2367
2368
  var obj = global.$.pool.cachebase[scope];
2368
2369
  if (!obj) {
2369
2370
  const dbConfig = {
2370
- file_path: config && config.dir ? './cachebase_' + scope + '.json' : '/cache/cachebase_' + scope + '.json',
2371
+ file_path: config && config.dir ? config.dir + '/' + scope + '.json' : '/cache/' + scope + '.json',
2371
2372
  ...(typeof config === 'object' && config ? config : {})
2372
2373
  };
2373
2374
  global.$.pool.cachebase[scope] = new CacheBase(dbConfig);
@@ -2379,5 +2380,5 @@ function cachebaseAdmin(scope, config) {
2379
2380
  // 导出类
2380
2381
  module.exports = {
2381
2382
  CacheBase,
2382
- cachebaseAdmin,
2383
+ cachebaseAdmin
2383
2384
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_cachebase",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "一个轻量级的本地缓存类库,提供与Redis兼容的API接口,支持过期时间设置、哈希表操作、数值操作、字符串操作等功能,以及完整的事件通知系统和多文件持久化功能。",
5
5
  "main": "index.js",
6
6
  "scripts": {