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

Conversation

VGirol
Copy link
Contributor

@VGirol VGirol commented May 22, 2024

When regenerating the conversions and if the queue connection is set to "sync", the jobs are not handled "asynchronously". So the execution time can be very long depending on the number of medias to handle. And in some cases, the script reached the maximum execution time defined in php.ini and exit with an error code.

This PR disable the maximum execution time if the queue connection is "sync".

Copy link
Member

@freekmurze freekmurze left a comment

Choose a reason for hiding this comment

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

Thanks!

Could you remove all code style changes?

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

@VGirol
Copy link
Contributor Author

VGirol commented May 22, 2024

Thanks!

Could you remove all code style changes?

I'm sorry. I didn't see that code style had changed.

@freekmurze freekmurze merged commit 37ecca8 into spatie:main May 23, 2024
9 checks passed
@freekmurze
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants