You are here

public function QueueMongodb::releaseItem in MongoDB 8

Release an item that the worker could not process

Parameters

object $item: The item to release.

Overrides QueueInterface::releaseItem

File

src/QueueMongodb.php, line 116
Contains \Drupal\mongodb\QueueMongodb

Class

QueueMongodb
MongoDB queue implementation.

Namespace

Drupal\mongodb

Code

public function releaseItem($item) {
  return $this->mongo
    ->get($this->collection)
    ->update(array(
    '_id' => $item->_id,
  ), array(
    '$set' => array(
      'expire' => 0,
    ),
  ));
}