mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
@ -15,14 +15,19 @@ class RunBackupCommand extends Command
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
Backup::query()
|
||||
->where('interval', $this->argument('interval'))
|
||||
->where('status', BackupStatus::RUNNING)
|
||||
->chunk(100, function ($backups) {
|
||||
->chunk(100, function ($backups) use (&$total) {
|
||||
/** @var Backup $backup */
|
||||
foreach ($backups as $backup) {
|
||||
app(RunBackup::class)->run($backup);
|
||||
$total++;
|
||||
}
|
||||
});
|
||||
|
||||
$this->info("{$total} backups started");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user