From 2833b2d119b82c174dde110fece4b9947297cbfb Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Wed, 28 Apr 2021 15:17:00 -0400 Subject: [PATCH] Add suggestion when not using workers (#58) --- src/Commands/StaticSiteGenerate.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Commands/StaticSiteGenerate.php b/src/Commands/StaticSiteGenerate.php index 3bd1236..5bc61aa 100644 --- a/src/Commands/StaticSiteGenerate.php +++ b/src/Commands/StaticSiteGenerate.php @@ -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. @@ -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(); } }