Skip to content

Commit

Permalink
Filter on jobid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewangeta committed Jan 9, 2021
1 parent 8d98680 commit e76fb82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/QueuesMongoDriver/Queues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class MongoQueue: Queue {
// Mark jobs that can't be finished as ready.
func push(_ id: JobIdentifier) -> EventLoopFuture<Void> {
mongodb["vapor_queue"]
.findAndModify(where: ["queue": "\(context.queueName.string)",
.findAndModify(where: ["jobid": id.string,
"queue": "\(context.queueName.string)",
"status": "processing"],
update: ["$set": ["status": MongoJobStatus.ready.rawValue]])
.execute()
Expand Down

0 comments on commit e76fb82

Please sign in to comment.