Skip to content

[Feature] How to override queue timeout? #229

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

Closed
amcsi opened this issue Jan 13, 2023 · 4 comments
Closed

[Feature] How to override queue timeout? #229

amcsi opened this issue Jan 13, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@amcsi
Copy link

amcsi commented Jan 13, 2023

My queue worker's default timeout is at 60 seconds which is ideal for most tasks.

But I have a lot of posts to make searchable for ElasticSearch and it can take up to 300 seconds to run, so I want to set the job timeout to that amount. How can I do that?

I think I would need to somehow add public $timeout = 300; to \Matchish\ScoutElasticSearch\Jobs\QueueableJob, but I can't make changes to that class that's part of the library.

@amcsi amcsi added the enhancement New feature or request label Jan 13, 2023
@matchish
Copy link
Owner

Feel free to open PR that set value for timeout from config file

@hkulekci
Copy link
Contributor

hkulekci commented Jan 26, 2023

What do you think about setting this configuration inside the [ImportCommand.php:52](https://github.com/matchish/laravel-scout-elasticsearch/blob/master/src/Console/Commands/ImportCommand.php#L52). We already reaching config in this command and we can put as :

        if (config('scout.queue')) {
            $job = (new QueueableJob())->chain([$job]);
            $job->timeout = config('elasticsearch.queue.timeout', 60);
        }

@matchish
Copy link
Owner

Looks perfect) Thank you @hkulekci

@matchish
Copy link
Owner

released. Thank you guys) @hkulekci @amcsi

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

No branches or pull requests

3 participants