@xuda.io/drive_module 1.1.996 → 1.1.998
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 +5 -36
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -815,7 +815,7 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
815
815
|
switch (drive_type) {
|
|
816
816
|
case "studio": {
|
|
817
817
|
debugger;
|
|
818
|
-
|
|
818
|
+
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
819
819
|
const ret = rimraf.sync(file.file_path); // delete the file
|
|
820
820
|
|
|
821
821
|
if (doc.type === "file") {
|
|
@@ -840,25 +840,10 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
840
840
|
if (doc.type === "file") {
|
|
841
841
|
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
842
842
|
}
|
|
843
|
-
// if (doc_ret.data.type === "directory") {
|
|
844
|
-
// const docs = await get_folder_docs(
|
|
845
|
-
// path.basename(file.path),
|
|
846
|
-
// drive_type,
|
|
847
|
-
// app_id_reference
|
|
848
|
-
// );
|
|
849
|
-
// for await (let doc of docs) {
|
|
850
|
-
// if (doc.type === "file") {
|
|
851
|
-
// await module.exports.delete_file_from_bucket(doc.bucket);
|
|
852
|
-
// }
|
|
853
|
-
// doc.ts = Date.now();
|
|
854
|
-
// doc.stat = 4;
|
|
855
|
-
// await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
856
|
-
// }
|
|
857
|
-
// }
|
|
858
843
|
|
|
859
844
|
doc.ts = Date.now();
|
|
860
845
|
doc.stat = 4;
|
|
861
|
-
save_ret = await
|
|
846
|
+
save_ret = await save_drive_doc(drive_type, app_id, doc);
|
|
862
847
|
|
|
863
848
|
misc_module.rsync_drive_resources_to_remote_servers(
|
|
864
849
|
"workspace",
|
|
@@ -868,28 +853,12 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
868
853
|
}
|
|
869
854
|
|
|
870
855
|
case "user": {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
await module.exports.delete_file_from_bucket(doc_ret.data.bucket);
|
|
874
|
-
}
|
|
875
|
-
if (doc_ret.data.type === "directory") {
|
|
876
|
-
const docs = await get_folder_docs(
|
|
877
|
-
path.basename(file.path),
|
|
878
|
-
drive_type,
|
|
879
|
-
null
|
|
880
|
-
);
|
|
881
|
-
for await (let doc of docs) {
|
|
882
|
-
if (doc.type === "file") {
|
|
883
|
-
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
884
|
-
}
|
|
885
|
-
doc.ts = Date.now();
|
|
886
|
-
doc.stat = 4;
|
|
887
|
-
await db_module.save_couch_doc("xuda_drive", doc);
|
|
888
|
-
}
|
|
856
|
+
if (doc.type === "file") {
|
|
857
|
+
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
889
858
|
}
|
|
890
859
|
doc_ret.data.ts = Date.now();
|
|
891
860
|
doc_ret.data.stat = 4;
|
|
892
|
-
save_ret = await
|
|
861
|
+
save_ret = await save_drive_doc(drive_type, app_id, doc);
|
|
893
862
|
|
|
894
863
|
misc_module.rsync_drive_resources_to_remote_servers(
|
|
895
864
|
"user",
|