mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 05:31:24 +00:00
Fixes/backup issues (#51)
* Fix: Error related to undefined Backup::size() * Fix: Disable signals if PCNTL isn't loaded to avoid fatal error (Fixes SIGINT is not defined on environments that are missing the PCNTL library)
This commit is contained in:
committed by
GitHub
parent
8788f3d504
commit
9bb4963e8a
@@ -36,7 +36,7 @@ class BackupsController extends ApiController
|
||||
return [
|
||||
'path' => $backup->path(),
|
||||
'created_at' => $backup->date()->format('Y-m-d H:i:s'),
|
||||
'size' => Format::humanReadableSize($backup->size()),
|
||||
'size' => Format::humanReadableSize($backup->sizeInBytes()),
|
||||
];
|
||||
})
|
||||
->toArray();
|
||||
|
||||
@@ -41,7 +41,7 @@ class DownloadBackupController extends ApiController
|
||||
$downloadHeaders = [
|
||||
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
|
||||
'Content-Type' => 'application/zip',
|
||||
'Content-Length' => $backup->size(),
|
||||
'Content-Length' => $backup->sizeInBytes(),
|
||||
'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
|
||||
'Pragma' => 'public',
|
||||
];
|
||||
|
||||
@@ -44,6 +44,9 @@ class CreateBackupJob implements ShouldQueue
|
||||
config(['backup.backup.destination.disks' => [$prefix.$fileDisk->driver]]);
|
||||
|
||||
$backupJob = BackupJobFactory::createFromArray(config('backup'));
|
||||
if (! defined('SIGINT')) {
|
||||
$backupJob->disableSignals();
|
||||
}
|
||||
|
||||
if ($this->data['option'] === 'only-db') {
|
||||
$backupJob->dontBackupFilesystem();
|
||||
|
||||
Reference in New Issue
Block a user