@xuda.io/xuda-worker-bundle-min 1.3.920 → 1.3.922

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 +17 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -7220,8 +7220,8 @@ func.utils.get_plugin_resource = function (
7220
7220
  if (typeof IS_PROCESS_SERVER !== "undefined") {
7221
7221
  return `${_conf.plugins_drive_path}/${_session.app_id}/node_modules/${plugin_name}/${resource}`;
7222
7222
  } else {
7223
- return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
7224
- // return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.app_id}`;
7223
+ // return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
7224
+ return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.app_id}`;
7225
7225
  }
7226
7226
  };
7227
7227
 
@@ -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
- const plugin_resource_res = await import(`${get_path(plugin_resource)}`);
7238
- resolve(plugin_resource_res);
7237
+ try {
7238
+ const plugin_resource_res = await import(
7239
+ `${get_path(plugin_resource)}`
7240
+ );
7241
+ resolve(plugin_resource_res);
7239
7242
 
7240
- var doc = {
7241
- _id: `cache_plugin_${plugin_name}_${plugin_resource}`,
7242
- data: JSON.stringify(plugin_resource_res),
7243
- docType: "cache_plugin",
7244
- };
7245
- // db.put(doc);
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.920",
3
+ "version": "1.3.922",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {