mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
fix backups
This commit is contained in:
parent
64785c5ab6
commit
1eb5ed038d
2 changed files with 7 additions and 8 deletions
|
@ -30,8 +30,6 @@ class RunBackup extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
// TODO - Don't run backups parallel
|
||||
return;
|
||||
// Delete backups older than 7 days
|
||||
$findBackupsForDeleting = Backup::where('created_at', '<', now()->subDays(7))->get();
|
||||
foreach ($findBackupsForDeleting as $backup) {
|
||||
|
|
|
@ -31,9 +31,6 @@ class RunHostingSubscriptionsBackup extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
// TODO - Don't run backups parallel
|
||||
return;
|
||||
|
||||
// Delete backups older than 7 days
|
||||
$findBackupsForDeleting = HostingSubscriptionBackup::where('created_at', '<', now()->subDays(7))->get();
|
||||
foreach ($findBackupsForDeleting as $backup) {
|
||||
|
@ -67,11 +64,15 @@ class RunHostingSubscriptionsBackup extends Command
|
|||
->get();
|
||||
|
||||
if ($getPendingBackups->count() > 0) {
|
||||
if ($getPendingBackups->count() > 3) {
|
||||
$this->info('There are more than 3 pending backups. Please wait for them to finish.');
|
||||
} else {
|
||||
foreach ($getPendingBackups as $pendingBackup) {
|
||||
$pendingBackup->startBackup();
|
||||
$this->info('Backup started.. ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for processing backups
|
||||
$getRunningBackups = HostingSubscriptionBackup::where('status', 'processing')->get();
|
||||
|
|
Loading…
Reference in a new issue