@xuda.io/drive_module 1.1.521 → 1.1.523

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 +5 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1881,7 +1881,6 @@ exports.get_drive_size = async function (req) {
1881
1881
  // ref = await _common.get_project_app_id(app_id, true);
1882
1882
  // }
1883
1883
 
1884
- debugger;
1885
1884
  let app_id_master, directoryPath;
1886
1885
  switch (drive_type) {
1887
1886
  case "user":
@@ -1905,6 +1904,10 @@ exports.get_drive_size = async function (req) {
1905
1904
  }
1906
1905
 
1907
1906
  size = await get_folder_size(directoryPath, drive_type, app_id_master, uid);
1907
+ if (drive_type === "workspace") {
1908
+ // calc datacenter
1909
+ size += await get_folder_size(directoryPath, drive_type, app_id);
1910
+ }
1908
1911
 
1909
1912
  return { code: 200, data: size };
1910
1913
  } catch (err) {
@@ -2046,7 +2049,7 @@ const get_folder_size = async function (dir, drive_type, app_id, uid) {
2046
2049
  if (doc.type === "directory") {
2047
2050
  await calculateSizeDocs(path.join("/", doc._id));
2048
2051
  } else {
2049
- totalSize += doc.size;
2052
+ totalSize += doc.size || 0;
2050
2053
  }
2051
2054
  }
2052
2055
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.521",
3
+ "version": "1.1.523",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {