You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Set SCOUT_QUEUE=false
Write a custom job that extends Scout's MakeSearchable and overwrite handle method
Specify it in a service provider: Scout::makeSearchableUsing(CustomMakeSearchable::class);
The text was updated successfully, but these errors were encountered:
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.
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 withSCOUT_QUEUE=true
, but it's being completely ignored when using it withSCOUT_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 whereSCOUT_QUEUE=false
is preferred, like on a CI.Instead of straight up ignoring the job, Scout could instead simply dispatch it on
sync
queue (withdispatch_sync
), which would both allow customizing thehandle
method of the job and run it in sync as expected:Would this change be welcomed?
Steps To Reproduce
SCOUT_QUEUE=false
MakeSearchable
and overwritehandle
methodScout::makeSearchableUsing(CustomMakeSearchable::class);
The text was updated successfully, but these errors were encountered: