src/Shell/QueueShell.php
public function end($in = null) {
		$processes = $this->QueuedJobs->getProcesses($in === 'server');
		if (!$processes) {
			$this->out('No processes found');

			return;
		}

		$this->out(count($processes) . ' processes:');
		foreach ($processes as $process => $timestamp) {
			$this->out(' - ' . $process . ' (last run @ ' . (new FrozenTime($timestamp)) . ')');
		}

		$options = array_keys($processes);
		$options[] = 'all';
		if ($in === null) {
			$in = $this->in('Process', $options, 'all');
		}

		if ($in === 'all' || $in === 'server') {
			foreach ($processes as $process => $timestamp) {
				$this->QueuedJobs->endProcess($process);
			}

			$this->out('All ' . count($processes) . ' processes ended.');

			return;
		}

		$this->QueuedJobs->endProcess($in);
	}
public function end($in = null) {
		$processes = $this->QueuedJobs->getProcesses($in === 'server');
		if (!$processes) {
			$this->out('No processes found');

			return;
		}

		$this->out(count($processes) . ' processes:');
		foreach ($processes as $process => $timestamp) {
			$this->out(' - ' . $process . ' (last run @ ' . (new FrozenTime($timestamp)) . ')');
		}

		$options = array_keys($processes);
		$options[] = 'all';
		if ($in === null) {
			$in = $this->in('Process', $options, 'all');
		}

		if ($in === 'all' || $in === 'server') {
			foreach ($processes as $process => $timestamp) {
				$this->QueuedJobs->endProcess($process);
			}

			$this->out('All ' . count($processes) . ' processes ended.');

			return;
		}

		$this->QueuedJobs->endProcess($in);
	}
public function end ( $ in = null ) { $ processes = $ this -> QueuedJobs -> getProcesses ( $ in === 'server' ) ; if ( ! $ processes ) { $ this -> out ( 'No processes found' ) ; return ; } $ this -> out ( count ( $ processes ) . ' processes:' ) ; foreach ( $ processes as $ process => $ timestamp ) { $ this -> out ( ' - ' . $ process . ' (last run @ ' . ( new FrozenTime ( $ timestamp ) ) . ')' ) ; } $ options = array_keys ( $ processes ) ; $ options [ ] = 'all' ; if ( $ in === null ) { $ in = $ this -> in ( 'Process' , $ options , 'all' ) ; } if ( $ in === 'all' || $ in === 'server' ) { foreach ( $ processes as $ process => $ timestamp ) { $ this -> QueuedJobs -> endProcess ( $ process ) ; } $ this -> out ( 'All ' . count ( $ processes ) . ' processes ended.' ) ; return ; } $ this -> QueuedJobs -> endProcess ( $ in ) ; }
Gracefully end running workers when deploying.

Use $in
- all: to end all workers on all servers
- server: to end the ones on this server

@param string|null $in
@return void
Gracefully end running workers when deploying .