Skip to content

Commit efaa724

Browse files
Ability to config queue connection for UpdateCollectionEntryOrder job (#210)
1 parent 00ff411 commit efaa724

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

config/eloquent-driver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'driver' => 'eloquent',
2727
'model' => \Statamic\Eloquent\Collections\CollectionModel::class,
2828
'update_entry_order_queue' => 'default',
29+
'update_entry_order_connection' => 'default',
2930
],
3031

3132
'collection_trees' => [

src/Collections/CollectionRepository.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,15 @@ public function updateEntryOrder(CollectionContract $collection, $ids = null)
8585
$collection->queryEntries()
8686
->get(['id'])
8787
->each(function ($entry) {
88-
UpdateCollectionEntryOrder::dispatch($entry->id())
89-
->onQueue(config('statamic.eloquent-driver.collections.update_entry_order_queue', 'default'));
88+
$dispatch = UpdateCollectionEntryOrder::dispatch($entry->id());
89+
90+
$connection = config('statamic.eloquent-driver.collections.update_entry_order_connection', 'default');
91+
92+
if ($connection != 'default') {
93+
$dispatch->onConnection($connection);
94+
}
95+
96+
$dispatch->onQueue(config('statamic.eloquent-driver.collections.update_entry_order_queue', 'default'));
9097
});
9198
}
9299
}

0 commit comments

Comments
 (0)