MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / obliterate

Method obliterate

php/src/Scripts.php:457–472  ·  view source on GitHub ↗

* Obliterate (completely destroy) the queue. * * @param int $count Maximum number of jobs to remove per iteration * @param bool $force Force obliteration even with active jobs * @return int Cursor position, 0 when complete */

(int $count, bool $force = false)

Source from the content-addressed store, hash-verified

455 * @return int Cursor position, 0 when complete
456 */
457 public function obliterate(int $count, bool $force = false): int
458 {
459 $keys = $this->getKeys(['meta', '']);
460 $result = $this->execScript('obliterate-2.lua', $keys, [$count, $force ? 1 : '']);
461
462 if (is_int($result) && $result < 0) {
463 if ($result === -1) {
464 throw new \RuntimeException('Cannot obliterate non-paused queue');
465 }
466 if ($result === -2) {
467 throw new \RuntimeException('Cannot obliterate queue with active jobs');
468 }
469 }
470
471 return (int) $result;
472 }
473
474 /**
475 * Move jobs to wait state (for retrying).

Callers

nothing calls this directly

Calls 2

getKeysMethod · 0.95
execScriptMethod · 0.95

Tested by

no test coverage detected