Skip to content

Commit

Permalink
feat: add ability to disable configure task
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr authored Aug 18, 2024
1 parent 8d32123 commit d59264f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Tasks/AlgoliaConfigure.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ class AlgoliaConfigure extends BuildTask

private static $segment = 'AlgoliaConfigure';

private static $enabled = true;

public function run($request)
{
$service = Injector::inst()->get(AlgoliaService::class);

if (!$this->config()->get('enabled')) {
echo 'Algolia configuration task is disabled.' . PHP_EOL;
return;
}

try {
if ($service->syncSettings()) {
echo 'Success.' . PHP_EOL;
Expand Down

0 comments on commit d59264f

Please sign in to comment.