Commit 0574eec 1 parent b941169 commit 0574eec Copy full SHA for 0574eec
File tree 1 file changed +12
-1
lines changed
packages/rocketchat-user-data-download/server
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,14 @@ const sendEmail = function(userId) {
319
319
} ;
320
320
321
321
const makeZipFile = function ( exportOperation ) {
322
+ createDir ( zipFolder ) ;
323
+
322
324
const targetFile = path . join ( zipFolder , `${ exportOperation . userId } .zip` ) ;
325
+ if ( fs . existsSync ( targetFile ) ) {
326
+ exportOperation . status = 'uploading' ;
327
+ return ;
328
+ }
329
+
323
330
const output = fs . createWriteStream ( targetFile ) ;
324
331
325
332
exportOperation . generatedFile = targetFile ;
@@ -424,14 +431,18 @@ const continueExportOperation = function(exportOperation) {
424
431
} ) ;
425
432
426
433
if ( isDownloadFinished ( exportOperation ) ) {
434
+ const targetFile = path . join ( zipFolder , `${ exportOperation . userId } .zip` ) ;
435
+ if ( fs . existsSync ( targetFile ) ) {
436
+ fs . unlinkSync ( targetFile ) ;
437
+ }
438
+
427
439
exportOperation . status = 'compressing' ;
428
440
return ;
429
441
}
430
442
}
431
443
432
444
if ( exportOperation . status === 'compressing' ) {
433
445
makeZipFile ( exportOperation ) ;
434
- exportOperation . status = 'uploading' ;
435
446
return ;
436
447
}
437
448
You can’t perform that action at this time.
0 commit comments