Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
244f40b8
Commit
244f40b8
authored
Mar 05, 2016
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge #769
parent
fe4b0aa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
MongoQueue.php
src/Jenssegers/Mongodb/Queue/MongoQueue.php
+41
-0
No files found.
src/Jenssegers/Mongodb/Queue/MongoQueue.php
View file @
244f40b8
...
...
@@ -49,4 +49,45 @@ class MongoQueue extends DatabaseQueue
$this
->
releaseJob
(
$job
[
'_id'
],
$attempts
);
}
}
/**
* Release the given job ID from reservation.
*
* @param string $id
*
* @return void
*/
protected
function
releaseJob
(
$id
,
$attempts
)
{
$this
->
database
->
table
(
$this
->
table
)
->
where
(
'_id'
,
$id
)
->
update
([
'reserved'
=>
0
,
'reserved_at'
=>
null
,
'attempts'
=>
$attempts
,
]);
}
/**
* Mark the given job ID as reserved.
*
* @param string $id
* @return void
*/
protected
function
markJobAsReserved
(
$id
)
{
$this
->
database
->
collection
(
$this
->
table
)
->
where
(
'_id'
,
$id
)
->
update
([
'reserved'
=>
1
,
'reserved_at'
=>
$this
->
getTime
(),
]);
}
/**
* Delete a reserved job from the queue.
*
* @param string $queue
* @param string $id
* @return void
*/
public
function
deleteReserved
(
$queue
,
$id
)
{
$this
->
database
->
table
(
$this
->
table
)
->
where
(
'_id'
,
$id
)
->
delete
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment