@xuda.io/xuda-worker-bundle-min 1.3.921 → 1.3.923
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/index.js +15 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7229,20 +7229,26 @@ func.utils.get_plugin_resource = function (
|
|
|
7229
7229
|
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
7230
7230
|
|
|
7231
7231
|
try {
|
|
7232
|
-
if (_session.worker_type === "Dev") throw "";
|
|
7232
|
+
if (_session.worker_type === "Dev") throw "bypass cache";
|
|
7233
7233
|
|
|
7234
7234
|
let ret = await db.get(`cache_plugin_${plugin_name}_${plugin_resource}`);
|
|
7235
7235
|
return resolve(ret.data);
|
|
7236
7236
|
} catch (err) {
|
|
7237
|
-
|
|
7238
|
-
|
|
7237
|
+
try {
|
|
7238
|
+
const plugin_resource_res = await import(
|
|
7239
|
+
`${get_path(plugin_resource)}`
|
|
7240
|
+
);
|
|
7241
|
+
resolve(plugin_resource_res);
|
|
7239
7242
|
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7243
|
+
var doc = {
|
|
7244
|
+
_id: `cache_plugin_${plugin_name}_${plugin_resource}`,
|
|
7245
|
+
data: JSON.stringify(plugin_resource_res),
|
|
7246
|
+
docType: "cache_plugin",
|
|
7247
|
+
};
|
|
7248
|
+
// db.put(doc);
|
|
7249
|
+
} catch (err) {
|
|
7250
|
+
console.error(err);
|
|
7251
|
+
}
|
|
7246
7252
|
}
|
|
7247
7253
|
});
|
|
7248
7254
|
};
|