Skip to content

Commit

Permalink
Add suggestion when not using workers (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga authored Apr 28, 2021
1 parent f1bd6ff commit 2833b2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Commands/StaticSiteGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StaticSiteGenerate extends Command
*
* @var string
*/
protected $signature = 'statamic:ssg:generate {--workers=1}';
protected $signature = 'statamic:ssg:generate {--workers=}';

/**
* The console command description.
Expand Down Expand Up @@ -51,8 +51,12 @@ public function handle()
{
Partyline::bind($this);

if (! $workers = $this->option('workers')) {
$this->comment('You may be able to speed up site generation significantly by installing spatie/fork and using multiple workers (requires PHP 8+).');
}

$this->generator
->workers($this->option('workers'))
->workers($workers ?? 1)
->generate();
}
}

0 comments on commit 2833b2d

Please sign in to comment.