@xuda.io/drive_module 1.1.1203 → 1.1.1205
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 +47 -47
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -519,11 +519,11 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
519
519
|
const { data: app_obj } = await db_module.get_app_obj(app_id);
|
|
520
520
|
if (app_obj?.app_type === 'datacenter') {
|
|
521
521
|
const host = `root@${app_obj.app_hosting_server.ip}`;
|
|
522
|
-
await _utils.run_ssh_script(`
|
|
522
|
+
await _utils.run_ssh_script(`ssh rm ${host}:/var/xuda/workspace_drive/${file_name}; `);
|
|
523
523
|
} else if (app_obj?.is_deployment) {
|
|
524
524
|
const { data: datacenter_obj } = await db_module.get_app_obj(app_obj.app_datacenter_id);
|
|
525
525
|
const host = `root@${datacenter_obj.app_hosting_server.ip}`;
|
|
526
|
-
await _utils.run_ssh_script(`
|
|
526
|
+
await _utils.run_ssh_script(`ssh rm ${host}:/var/xuda/workspace_drive/${file_name}; `);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
}
|
|
@@ -1722,31 +1722,31 @@ exports.delete_file_from_bucket = async function (bucket) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
};
|
|
1724
1724
|
|
|
1725
|
-
const get_folder_docs = async function (dir, drive_type, app_id) {
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
};
|
|
1725
|
+
// const get_folder_docs = async function (dir, drive_type, app_id) {
|
|
1726
|
+
// var docs = [];
|
|
1727
|
+
// const get_docs = async function (dirPath) {
|
|
1728
|
+
// const opt = {
|
|
1729
|
+
// selector: {
|
|
1730
|
+
// docType: `${drive_type}_drive`,
|
|
1731
|
+
// stat: 3,
|
|
1732
|
+
// file_path: path.join('/', dirPath),
|
|
1733
|
+
// },
|
|
1734
|
+
// limit: 99999,
|
|
1735
|
+
// };
|
|
1736
|
+
// const ret = drive_type === 'user' ? await db_module.find_couch_query('xuda_drive', opt) : await db_module.find_app_couch_query(app_id, opt);
|
|
1737
|
+
// for await (let doc of ret.docs) {
|
|
1738
|
+
// if (doc.type === 'directory') {
|
|
1739
|
+
// await get_docs(path.join('/', doc._id));
|
|
1740
|
+
// } else {
|
|
1741
|
+
// docs.push(doc);
|
|
1742
|
+
// }
|
|
1743
|
+
// }
|
|
1744
|
+
// };
|
|
1745
|
+
|
|
1746
|
+
// await get_docs(dir);
|
|
1747
|
+
|
|
1748
|
+
// return docs;
|
|
1749
|
+
// };
|
|
1750
1750
|
|
|
1751
1751
|
exports.update_drive_file_tags = async function (req, job_id, headers) {
|
|
1752
1752
|
try {
|
|
@@ -2155,28 +2155,28 @@ setTimeout(async function () {
|
|
|
2155
2155
|
// fix_date_modified();
|
|
2156
2156
|
}, 2000);
|
|
2157
2157
|
|
|
2158
|
-
const fix_date_modified = async function () {
|
|
2159
|
-
|
|
2160
|
-
|
|
2158
|
+
// const fix_date_modified = async function () {
|
|
2159
|
+
// const app_id = 'dtcb1674f63e47ddcb11865cefdfb4483fb';
|
|
2160
|
+
// const ret = await db_module.find_app_couch_query(app_id, { selector: { docType: 'workspace_drive' }, limit: 99999 });
|
|
2161
2161
|
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2162
|
+
// for (doc of ret.docs) {
|
|
2163
|
+
// if (!doc.date_modified) {
|
|
2164
|
+
// doc.date_modified = doc.date_created;
|
|
2165
|
+
// }
|
|
2166
|
+
// }
|
|
2167
2167
|
|
|
2168
|
-
|
|
2169
|
-
|
|
2168
|
+
// const save_ret = await db_module.sava_app_couch_bulk_docs(app_id, ret.docs);
|
|
2169
|
+
// console.log('fix_date_modified', save_ret, ret);
|
|
2170
2170
|
|
|
2171
|
-
|
|
2172
|
-
|
|
2171
|
+
// // const db_name = 'db_prj_3uh4q1zj0llw3mj4wgifh1';
|
|
2172
|
+
// // const ret = await db_module.find_couch_query(db_name, { selector: { docType: 'workspace_drive' } });
|
|
2173
2173
|
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2174
|
+
// // for (doc of ret.docs) {
|
|
2175
|
+
// // if (!doc.date_modified) {
|
|
2176
|
+
// // doc.date_modified = 0;
|
|
2177
|
+
// // }
|
|
2178
|
+
// // }
|
|
2179
2179
|
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
};
|
|
2180
|
+
// // const save_ret = await db_module.save_couch_bulk_docs(db_name, ret.docs);
|
|
2181
|
+
// // console.log('fix_date_modified', save_ret, ret);
|
|
2182
|
+
// };
|