@pisell/core 1.0.29 → 1.0.30
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.
- package/es/request/cache.js +2 -1
- package/es/request/type.d.ts +1 -0
- package/es/tasks/index.d.ts +1 -1
- package/lib/request/cache.js +2 -1
- package/lib/request/type.d.ts +1 -0
- package/lib/tasks/index.d.ts +1 -1
- package/package.json +1 -1
package/es/request/cache.js
CHANGED
|
@@ -28,8 +28,9 @@ var MAX_CACHE_TIME = 7 * 60 * 60 * 1000;
|
|
|
28
28
|
var createCacheKey = function createCacheKey(url, data, cache) {
|
|
29
29
|
var _getConfig = getConfig(),
|
|
30
30
|
storage = _getConfig.storage;
|
|
31
|
+
var _data = (cache === null || cache === void 0 ? void 0 : cache.cacheKeyData) || data;
|
|
31
32
|
// @ts-ignore
|
|
32
|
-
return cache.key ? storage.createKey(cache.key) : md5("".concat(url, "_").concat(JSON.stringify(
|
|
33
|
+
return cache.key ? storage.createKey(cache.key) : md5("".concat(url, "_").concat(JSON.stringify(_data)));
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
/**
|
package/es/request/type.d.ts
CHANGED
package/es/tasks/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export declare class TasksManager {
|
|
|
109
109
|
*/
|
|
110
110
|
getQueueStatus(module: string, queueId: string): {
|
|
111
111
|
isRunning: boolean;
|
|
112
|
-
status: "
|
|
112
|
+
status: "uncompleted" | "completed";
|
|
113
113
|
progress: {
|
|
114
114
|
total: number;
|
|
115
115
|
completed: number;
|
package/lib/request/cache.js
CHANGED
|
@@ -44,7 +44,8 @@ var CACHES = {};
|
|
|
44
44
|
var MAX_CACHE_TIME = 7 * 60 * 60 * 1e3;
|
|
45
45
|
var createCacheKey = (url, data, cache) => {
|
|
46
46
|
const { storage } = (0, import_config.getConfig)();
|
|
47
|
-
|
|
47
|
+
let _data = (cache == null ? void 0 : cache.cacheKeyData) || data;
|
|
48
|
+
return cache.key ? storage.createKey(cache.key) : (0, import_js_md5.default)(`${url}_${JSON.stringify(_data)}`);
|
|
48
49
|
};
|
|
49
50
|
var setCache = async (key, data, cache) => {
|
|
50
51
|
const { storage } = (0, import_config.getConfig)();
|
package/lib/request/type.d.ts
CHANGED
package/lib/tasks/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export declare class TasksManager {
|
|
|
109
109
|
*/
|
|
110
110
|
getQueueStatus(module: string, queueId: string): {
|
|
111
111
|
isRunning: boolean;
|
|
112
|
-
status: "
|
|
112
|
+
status: "uncompleted" | "completed";
|
|
113
113
|
progress: {
|
|
114
114
|
total: number;
|
|
115
115
|
completed: number;
|