Better backup storage

This commit is contained in:
Dane Everitt 2020-08-27 19:59:01 -07:00
parent 4b919cabd2
commit 1967e3f7fd
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -48,12 +48,13 @@ class BackupStatusController extends Controller
);
}
$model->update([
'is_successful' => $request->input('successful') ? true : false,
'checksum' => $request->input('checksum_type') . ':' . $request->input('checksum'),
'bytes' => $request->input('size'),
$successful = $request->input('successful') ? true : false;
$model->forceFill([
'is_successful' => $successful,
'checksum' => $successful ? ($request->input('checksum_type') . ':' . $request->input('checksum')) : null,
'bytes' => $successful ? $request->input('size') : 0,
'completed_at' => CarbonImmutable::now(),
]);
])->save();
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);
}