Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not limit the maximum execution time if the queue connection is "sync" #3618

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Conversions/Commands/RegenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ public function handle(MediaRepository $mediaRepository, FileManipulator $fileMa

$this->fileManipulator = $fileManipulator;

if (! $this->confirmToProceed()) {
if (!$this->confirmToProceed()) {
return;
}

$mediaFiles = $this->getMediaToBeRegenerated();

$progressBar = $this->output->createProgressBar($mediaFiles->count());

if (config('media-library.queue_connection_name') == 'sync') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you make this a strict check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

set_time_limit(0);
}

$mediaFiles->each(function (Media $media) use ($progressBar) {
try {
$this->fileManipulator->createDerivedFiles(
Expand Down Expand Up @@ -104,7 +108,7 @@ protected function getMediaIds(): array
{
$mediaIds = $this->option('ids');

if (! is_array($mediaIds)) {
if (!is_array($mediaIds)) {
$mediaIds = explode(',', (string) $mediaIds);
}

Expand Down