mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Store S3 upload_id in the database for backups
This commit is contained in:
@@ -47,6 +47,7 @@ class BackupRemoteUploadController extends Controller
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \Throwable
|
||||
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function __invoke(Request $request, string $backup)
|
||||
@@ -101,8 +102,12 @@ class BackupRemoteUploadController extends Controller
|
||||
)->getUri()->__toString();
|
||||
}
|
||||
|
||||
return new JsonResponse([
|
||||
// Set the upload_id on the backup in the database.
|
||||
$backup->forceFill([
|
||||
'upload_id' => $params['UploadId'],
|
||||
])->saveOrFail();
|
||||
|
||||
return new JsonResponse([
|
||||
'parts' => $parts,
|
||||
'part_size' => self::PART_SIZE,
|
||||
]);
|
||||
|
||||
@@ -78,7 +78,7 @@ class BackupStatusController extends Controller
|
||||
$params = [
|
||||
'Bucket' => $adapter->getBucket(),
|
||||
'Key' => sprintf('%s/%s.tar.gz', $backup->server->uuid, $backup->uuid),
|
||||
'UploadId' => $request->input('upload_id'),
|
||||
'UploadId' => $backup->upload_id,
|
||||
];
|
||||
|
||||
// If the backup was not successful, send an AbortMultipartUpload request.
|
||||
|
||||
Reference in New Issue
Block a user