fix backups

This commit is contained in:
Bozhidar 2024-04-29 13:30:01 +03:00
parent 64785c5ab6
commit 1eb5ed038d
2 changed files with 7 additions and 8 deletions

View file

@ -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) {

View file

@ -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,9 +64,13 @@ class RunHostingSubscriptionsBackup extends Command
->get();
if ($getPendingBackups->count() > 0) {
foreach ($getPendingBackups as $pendingBackup) {
$pendingBackup->startBackup();
$this->info('Backup started.. ');
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.. ');
}
}
}