@xuda.io/drive_module 1.1.1400 → 1.1.1401
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 +7 -7
- package/index_ms.mjs +6 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -31,7 +31,7 @@ const _utils = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda-cpi
|
|
|
31
31
|
const module_path = path.join(process.env.XUDA_HOME, 'cpi') + (!_conf.is_debug ? '/node_modules/@xuda.io' : '');
|
|
32
32
|
const fs_module = await import(`${module_path}/fs_module/index.mjs`);
|
|
33
33
|
const db_module = await import(`${module_path}/db_module/index.mjs`);
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
const jobs_ms = await import(`${module_path}/jobs_module/index_ms.mjs`);
|
|
36
36
|
const plugins_ms = await import(`${module_path}/plugins_module/index_ms.mjs`);
|
|
37
37
|
const email_ms = await import(`${module_path}/email_module/index_ms.mjs`);
|
|
@@ -526,7 +526,7 @@ export const delete_drive_files = async (req, job_id, headers) => {
|
|
|
526
526
|
save_ret = await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
|
|
529
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id_reference);
|
|
530
530
|
break;
|
|
531
531
|
}
|
|
532
532
|
|
|
@@ -625,7 +625,7 @@ export const update_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
625
625
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
626
626
|
save_ret = await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
627
627
|
|
|
628
|
-
|
|
628
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id_reference);
|
|
629
629
|
break;
|
|
630
630
|
}
|
|
631
631
|
case 'workspace': {
|
|
@@ -752,7 +752,7 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
752
752
|
await create_directory(fs_target_dir, 0o775, true);
|
|
753
753
|
doc._id = target_dir;
|
|
754
754
|
save_ret = await db_module.save_app_couch_doc(app_id_master, doc);
|
|
755
|
-
|
|
755
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id_master);
|
|
756
756
|
break;
|
|
757
757
|
}
|
|
758
758
|
|
|
@@ -871,7 +871,7 @@ export const rename_drive_folder = async (req) => {
|
|
|
871
871
|
doc_ret.data._id = new_path;
|
|
872
872
|
delete doc_ret.data._rev;
|
|
873
873
|
|
|
874
|
-
|
|
874
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id_reference);
|
|
875
875
|
break;
|
|
876
876
|
}
|
|
877
877
|
case 'workspace': {
|
|
@@ -1207,7 +1207,7 @@ export const upload_drive_file = async (req, job_id, headers = {}, file_obj) =>
|
|
|
1207
1207
|
doc._id = file_name;
|
|
1208
1208
|
|
|
1209
1209
|
save_ret = await db_module.save_app_couch_doc(ref, doc);
|
|
1210
|
-
|
|
1210
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id);
|
|
1211
1211
|
break;
|
|
1212
1212
|
}
|
|
1213
1213
|
case 'workspace': {
|
|
@@ -2039,7 +2039,7 @@ export default {
|
|
|
2039
2039
|
await _utils.run_ssh_script(`npm i --prefix ${studio_drive_script_program_folder};`);
|
|
2040
2040
|
const build_ret = await _utils.run_ssh_script(`npm run build --prefix ${studio_drive_script_program_folder};`);
|
|
2041
2041
|
|
|
2042
|
-
|
|
2042
|
+
misc_ms.rsync_drive_resources_to_remote_servers('studio', app_id);
|
|
2043
2043
|
const vite_build_res = {
|
|
2044
2044
|
code: 1,
|
|
2045
2045
|
data: {
|
package/index_ms.mjs
CHANGED
|
@@ -46,7 +46,7 @@ const send_to_queue =async function(ms_method, ...args) {
|
|
|
46
46
|
const timeout = setTimeout(() => {
|
|
47
47
|
delete queue[queue_id];
|
|
48
48
|
reject(new Error(`Queue timeout for ${ms_method}`));
|
|
49
|
-
},
|
|
49
|
+
}, 300000); // 300 second timeout
|
|
50
50
|
|
|
51
51
|
// Wrap resolve to clean up
|
|
52
52
|
queue[queue_id].resolve = (value) => {
|
|
@@ -61,7 +61,8 @@ const send_to_queue =async function(ms_method, ...args) {
|
|
|
61
61
|
delete queue[queue_id];
|
|
62
62
|
reject(error);
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
|
|
65
|
+
try{
|
|
65
66
|
global[`_${global.module_in}_ch`].sendToQueue(
|
|
66
67
|
'drive_module',
|
|
67
68
|
Buffer.from(
|
|
@@ -74,6 +75,9 @@ const send_to_queue =async function(ms_method, ...args) {
|
|
|
74
75
|
)
|
|
75
76
|
);
|
|
76
77
|
|
|
78
|
+
}catch(err){
|
|
79
|
+
debugger
|
|
80
|
+
}
|
|
77
81
|
})
|
|
78
82
|
|
|
79
83
|
};
|