Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 8 additions & 3 deletions config/scout.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@
|--------------------------------------------------------------------------
|
| This option allows you to control if the operations that sync your data
| with your search engines are queued. When this is set to "true" then
| all automatic data syncing will get queued for better performance.
| with your search engines are queued. When enabled, all automatic data
| syncing will get queued for better performance. You can also specify
| the queue connection and queue name to use.
|
*/

'queue' => env('SCOUT_QUEUE', false),
'queue' => [
'enable' => env('SCOUT_QUEUE', false),
'connection' => env('SCOUT_QUEUE_CONNECTION'),
'queue' => env('SCOUT_QUEUE_NAME'),
],

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/Searchable.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function queueMakeSearchable($models)
return;
}

if (! config('scout.queue')) {
if (! config('scout.queue.enable')) {
return $this->syncMakeSearchable($models);
}

Expand Down Expand Up @@ -103,7 +103,7 @@ public function queueRemoveFromSearch($models)
return;
}

if (! config('scout.queue')) {
if (! config('scout.queue.enable')) {
return $this->syncRemoveFromSearch($models);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/SearchableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function test_overridden_make_searchable_is_dispatched()
{
Queue::fake();

config()->set('scout.queue', true);
config()->set('scout.queue.enable', true);
Scout::makeSearchableUsing(OverriddenMakeSearchable::class);

$collection = m::mock();
Expand Down Expand Up @@ -114,7 +114,7 @@ public function test_overridden_remove_from_search_is_dispatched()
{
Queue::fake();

config()->set('scout.queue', true);
config()->set('scout.queue.enable', true);
Scout::removeFromSearchUsing(OverriddenRemoveFromSearch::class);

$collection = m::mock();
Expand Down