Skip to content

Commit

Permalink
Fixed backup is running loader and AWS CLI S3 exit code 2
Browse files Browse the repository at this point in the history
- The backup 'is running' spinner remain stuck when the AWS CLI S3 generates an error
- The backup don't continue if the previous file/folder generate an error with an exit code 2 of AWS CLI
  • Loading branch information
ulver2812 committed Mar 12, 2019
1 parent 8cd6aa7 commit e153360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/providers/aws.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class AwsService {

proc.on('close', (code) => {
this.processedHandler.killJobProcess(job.id, proc.pid);
if (code === 0) {
if (code === 0 || code === 2) {
next();
} else {
return callback(null, null);
Expand Down Expand Up @@ -191,6 +191,7 @@ export class AwsService {
let timeout = null;
if ( job.maxExecutionTime > 0 ) {
timeout = setTimeout(() => {
this.logService.printLog(LogType.INFO, 'The job ' + job.name + ' has just stopped because hit the maximum execution time. \r\n');
this.processedHandler.killJobProcesses(job.id);
}, job.maxExecutionTime);
}
Expand All @@ -202,6 +203,7 @@ export class AwsService {
}

job.setIsRunning(false);
this.jobService.save(job);

if (job.type !== JobType.Live) {
this.logService.printLog(LogType.INFO, 'End job: ' + job.name);
Expand Down

0 comments on commit e153360

Please sign in to comment.