Cleanup remote backup controllers

This commit is contained in:
Matthew Penner 2020-12-06 15:19:54 -07:00
parent 1ce6d3bbba
commit 00429c3911
2 changed files with 8 additions and 19 deletions

View file

@ -60,7 +60,6 @@ class BackupStatusController extends Controller
$successful = $request->input('successful') ? true : false;
// TODO: Still run s3 code even if this fails.
$model->forceFill([
'is_successful' => $successful,
'checksum' => $successful ? ($request->input('checksum_type') . ':' . $request->input('checksum')) : null,
@ -85,14 +84,13 @@ class BackupStatusController extends Controller
// If the backup was not successful, send an AbortMultipartUpload request.
if (! $successful) {
$client->execute($client->getCommand('AbortMultipartUpload', $params));
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);
} else {
// Otherwise send a CompleteMultipartUpload request.
$params['MultipartUpload'] = [
'Parts' => $client->execute($client->getCommand('ListParts', $params))['Parts'],
];
$client->execute($client->getCommand('CompleteMultipartUpload', $params));
}
// Otherwise send a CompleteMultipartUpload request.
$params['MultipartUpload'] = [
'Parts' => $client->execute($client->getCommand('ListParts', $params))['Parts'],
];
$client->execute($client->getCommand('CompleteMultipartUpload', $params));
}
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);