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([ $successful = $request->input('successful') ? true : false;
'is_successful' => $request->input('successful') ? true : false, $model->forceFill([
'checksum' => $request->input('checksum_type') . ':' . $request->input('checksum'), 'is_successful' => $successful,
'bytes' => $request->input('size'), 'checksum' => $successful ? ($request->input('checksum_type') . ':' . $request->input('checksum')) : null,
'bytes' => $successful ? $request->input('size') : 0,
'completed_at' => CarbonImmutable::now(), 'completed_at' => CarbonImmutable::now(),
]); ])->save();
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT); return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);
} }