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

Scout::makeSearchableUsing is ignored with SCOUT_QUEUE=false #755

Closed
oprypkhantc opened this issue Aug 18, 2023 · 2 comments
Closed

Scout::makeSearchableUsing is ignored with SCOUT_QUEUE=false #755

oprypkhantc opened this issue Aug 18, 2023 · 2 comments

Comments

@oprypkhantc
Copy link

Scout Version

10.2.4

Scout Driver

Algolia

Laravel Version

10.19.0

PHP Version

8.1.21

Database Driver & Version

No response

SDK Version

Other (ElasticSearch)

Meilisearch CLI Version

No response

Description

Hey.

Scout allows specifying a job that is used to sync models into a search driver through Scout::makeSearchableUsing(CustomMakeSearchable::class);. It works with SCOUT_QUEUE=true, but it's being completely ignored when using it with SCOUT_QUEUE=false.

Although it sort of makes sense, this bug makes it so that you can't customize the handle method of the said job in some environments where SCOUT_QUEUE=false is preferred, like on a CI.

Instead of straight up ignoring the job, Scout could instead simply dispatch it on sync queue (with dispatch_sync), which would both allow customizing the handle method of the job and run it in sync as expected:

Would this change be welcomed?

Steps To Reproduce

  1. Set SCOUT_QUEUE=false
  2. Write a custom job that extends Scout's MakeSearchable and overwrite handle method
  3. Specify it in a service provider: Scout::makeSearchableUsing(CustomMakeSearchable::class);
@github-actions
Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@driesvints
Copy link
Member

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.

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

No branches or pull requests

3 participants