@xuda.io/drive_module 1.1.1197 → 1.1.1199

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 +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -620,7 +620,8 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
620
620
  const host = `root@${app_obj.app_hosting_server.ip}`;
621
621
  await _utils.run_ssh_script(`scp ${tempPath} ${host}:/var/xuda/workspace_drive/${file_name}; `);
622
622
  } else if (app_obj?.is_deployment) {
623
- const host = `root@${app_obj.app_hosting_server.ip}`;
623
+ const { data: datacenter_obj } = await db_module.get_app_obj(app_obj.app_datacenter_id);
624
+ const host = `root@${datacenter_obj.app_hosting_server.ip}`;
624
625
  await _utils.run_ssh_script(`scp ${tempPath} ${host}:/var/xuda/workspace_drive/${file_name}; `);
625
626
  } else {
626
627
  doc.bucket[`${process.env.XUDA_HOSTNAME}`] = await upload_file_to_spaces(tempPath, app_id_master, drive_type, file_name);
@@ -1171,9 +1172,12 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
1171
1172
  // if file uploaded from deployment or from datacenter then save to the datacenter server fs
1172
1173
  const { data: app_obj } = await db_module.get_app_obj(app_id);
1173
1174
  if (app_obj?.app_type === 'datacenter') {
1174
- //app_obj.is_deployment // not possible, every deployment will have is own upload mechanism
1175
1175
  const host = `root@${app_obj.app_hosting_server.ip}`;
1176
1176
  await _utils.run_ssh_script(`scp ${tempPath} ${host}:/var/xuda/workspace_drive/${file_name}; `);
1177
+ } else if (app_obj?.is_deployment) {
1178
+ const { data: datacenter_obj } = await db_module.get_app_obj(app_obj.app_datacenter_id);
1179
+ const host = `root@${datacenter_obj.app_hosting_server.ip}`;
1180
+ await _utils.run_ssh_script(`scp ${tempPath} ${host}:/var/xuda/workspace_drive/${file_name}; `);
1177
1181
  } else {
1178
1182
  doc.bucket = {
1179
1183
  [`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(tempPath, ref, drive_type, file_name),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1197",
3
+ "version": "1.1.1199",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {