Skip to content

Commit

Permalink
only force when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Jan 18, 2024
1 parent d11c578 commit c430c77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Job/AvatarGenerationJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@

class AvatarGenerationJob extends AbstractJob
{
public function __construct(
protected bool $force = false
) {
}

public function handle(GenerateBoringAvatars $command, Container $container): void
{
$command->setLaravel($container);

$command->run(new ArrayInput(['--force' => true]), new NullOutput());
$command->run(new ArrayInput($this->force ? ['--force' => true] : []), new NullOutput());
}
}
2 changes: 1 addition & 1 deletion src/Listener/SettingsChanged.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __invoke(Saved $event)
}, ARRAY_FILTER_USE_KEY);

if (!empty($keysWithPrefix)) {
$this->queue->push(new AvatarGenerationJob());
$this->queue->push(new AvatarGenerationJob(true));
}
}
}

0 comments on commit c430c77

Please sign in to comment.