Skip to content

Commit 4f3c115

Browse files
authored
Merge pull request #574 from rosamarsky/add-index-to-mongodb-collection
Added index for queue field in the enqueue collection
2 parents 057aeda + 7b8e1d5 commit 4f3c115

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/mongodb/MongodbContext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public function getConfig(): array
158158
public function createCollection(): void
159159
{
160160
$collection = $this->getCollection();
161+
$collection->createIndex(['queue' => 1], ['name' => 'enqueue_queue']);
161162
$collection->createIndex(['priority' => -1, 'published_at' => 1], ['name' => 'enqueue_priority']);
162163
$collection->createIndex(['delayed_until' => 1], ['name' => 'enqueue_delayed']);
163164
}

0 commit comments

Comments
 (0)