66use MongoDB \DeleteResult ;
77use MongoDB \Driver \Cursor ;
88use MongoDB \InsertOneResult ;
9- use Mongolid \Connection \Pool ;
9+ use Mongolid \Connection \Connection ;
1010
1111/**
1212 * Persistence layer that is used to save failed queue jobs on MongoDB.
@@ -23,17 +23,17 @@ class FailedJobsService
2323 /**
2424 * Connections that are going to be used to interact with database.
2525 *
26- * @var Pool
26+ * @var Connection
2727 */
28- protected $ connPool ;
28+ protected $ connection ;
2929
3030 /**
31- * @param Pool $connPool Connections that are going to be used to interact with MongoDB
32- * @param string $collection Collection where jobs will be stored
31+ * @param Connection $connection Connections that are going to be used to interact with MongoDB
32+ * @param string $collection Collection where jobs will be stored
3333 */
34- public function __construct (Pool $ connPool , string $ collection = 'failed_jobs ' )
34+ public function __construct (Connection $ connection , string $ collection = 'failed_jobs ' )
3535 {
36- $ this ->connPool = $ connPool ;
36+ $ this ->connection = $ connection ;
3737 $ this ->collection = $ collection ;
3838 }
3939
@@ -88,9 +88,8 @@ public function drop()
8888 */
8989 protected function rawCollection (): Collection
9090 {
91- $ conn = $ this ->connPool ->getConnection ();
92- $ database = $ conn ->defaultDatabase ;
91+ $ database = $ this ->connection ->defaultDatabase ;
9392
94- return $ conn -> getRawConnection ()->$ database ->{$ this ->collection };
93+ return $ this -> connection -> getClient ()->$ database ->{$ this ->collection };
9594 }
9695}
0 commit comments