File tree 1 file changed +4
-6
lines changed
src/Jenssegers/Mongodb/Queue
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 4
4
use Illuminate \Queue \DatabaseQueue ;
5
5
use Illuminate \Queue \Jobs \DatabaseJob ;
6
6
use MongoDB \Operation \FindOneAndUpdate ;
7
- use DB ;
8
7
9
8
class MongoQueue extends DatabaseQueue
10
9
{
11
10
/**
12
11
* Pop the next job off of the queue.
13
12
*
14
- * @param string $queue
15
- *
13
+ * @param string $queue
16
14
* @return \Illuminate\Contracts\Queue\Job|null
17
15
*/
18
16
public function pop ($ queue = null )
@@ -47,7 +45,7 @@ public function pop($queue = null)
47
45
*/
48
46
protected function getNextAvailableJobAndReserve ($ queue )
49
47
{
50
- $ job = DB :: getCollection ($ this ->table )->findOneAndUpdate (
48
+ $ job = $ this -> database -> getCollection ($ this ->table )->findOneAndUpdate (
51
49
[
52
50
'queue ' => $ this ->getQueue ($ queue ),
53
51
'reserved ' => 0 ,
@@ -98,7 +96,7 @@ protected function releaseJobsThatHaveBeenReservedTooLong($queue)
98
96
* Release the given job ID from reservation.
99
97
*
100
98
* @param string $id
101
- *
99
+ * @param int $attempts
102
100
* @return void
103
101
*/
104
102
protected function releaseJob ($ id , $ attempts )
@@ -119,6 +117,6 @@ protected function releaseJob($id, $attempts)
119
117
*/
120
118
public function deleteReserved ($ queue , $ id )
121
119
{
122
- $ this ->database ->table ($ this ->table )->where ('_id ' , $ id )->delete ();
120
+ $ this ->database ->collection ($ this ->table )->where ('_id ' , $ id )->delete ();
123
121
}
124
122
}
You can’t perform that action at this time.
0 commit comments