@xuda.io/drive_module 1.1.1187 → 1.1.1189
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 +9 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1173,15 +1173,18 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1173
1173
|
// };
|
|
1174
1174
|
// }
|
|
1175
1175
|
// }
|
|
1176
|
-
|
|
1176
|
+
debugger;
|
|
1177
1177
|
// if file uploaded from deployment or from datacenter then save to the datacenter server fs
|
|
1178
1178
|
const { data: app_obj } = await db_module.get_app_obj(app_id);
|
|
1179
|
-
if (app_obj
|
|
1179
|
+
if (app_obj?.app_type === 'datacenter') {
|
|
1180
|
+
//app_obj.is_deployment // not possible, every deployment will have is own upload mechanism
|
|
1181
|
+
const host = `root@${app_obj.app_hosting_server.ip}`;
|
|
1182
|
+
await _utils.run_ssh_script(`scp tempPath ${host}:/var/xuda/workspace_drive/*; `);
|
|
1183
|
+
} else {
|
|
1184
|
+
doc.bucket = {
|
|
1185
|
+
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(tempPath, ref, drive_type, file_name),
|
|
1186
|
+
};
|
|
1180
1187
|
}
|
|
1181
|
-
|
|
1182
|
-
doc.bucket = {
|
|
1183
|
-
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(tempPath, ref, drive_type, file_name),
|
|
1184
|
-
};
|
|
1185
1188
|
doc._id = file_name;
|
|
1186
1189
|
save_ret = await db_module.save_app_couch_doc(await _common.get_project_app_id(req.app_id), doc);
|
|
1187
1190
|
// misc_module.rsync_drive_resources_to_remote_servers('workspace', app_id);
|