@xuda.io/drive_module 1.1.1417 → 1.1.1418
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.mjs +15 -13
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -521,22 +521,24 @@ export const delete_drive_files = async (req, job_id, headers) => {
|
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
case 'workspace': {
|
|
524
|
-
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
524
|
+
// const app_id_reference = await _common.get_project_app_id(app_id);
|
|
525
525
|
|
|
526
526
|
if (doc.type === 'file') {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
527
|
+
try {
|
|
528
|
+
if (doc.bucket) {
|
|
529
|
+
await delete_file_from_bucket(doc.bucket);
|
|
530
|
+
} else {
|
|
531
|
+
const { data: app_obj } = await db_module.get_app_obj(app_id);
|
|
532
|
+
if (app_obj?.app_type === 'datacenter') {
|
|
533
|
+
const host = `root@${app_obj.app_hosting_server.ip}`;
|
|
534
|
+
await _utils.run_ssh_script(`ssh ${host} "mv /var/xuda/workspace_drive/${doc.server_file_name} /tmp/;" `);
|
|
535
|
+
} else if (app_obj?.is_deployment) {
|
|
536
|
+
const { data: datacenter_obj } = await db_module.get_app_obj(app_obj.app_datacenter_id);
|
|
537
|
+
const host = `root@${datacenter_obj.app_hosting_server.ip}`;
|
|
538
|
+
await _utils.run_ssh_script(`ssh ${host} "mv /var/xuda/workspace_drive/${doc.server_file_name} /tmp/;" `);
|
|
539
|
+
}
|
|
538
540
|
}
|
|
539
|
-
}
|
|
541
|
+
} catch (error) {}
|
|
540
542
|
}
|
|
541
543
|
|
|
542
544
|
doc.ts = Date.now();
|