Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cake4'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	README.md
#	composer.json
#	src/Command/InfoCommand.php
#	tests/TestCase/Command/JobCommandTest.php
#	tests/TestCase/Controller/Admin/QueueControllerTest.php
#	tests/TestCase/Model/Table/QueuedJobsTableTest.php
#	tests/TestCase/View/Helper/QueueProgressHelperTest.php
  • Loading branch information
dereuromark committed Nov 28, 2023
2 parents 54283fc + 5adb5b7 commit 3e6f21b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
composer.lock
schema-dump-default.lock
composer.phar
/.phpunit.cache
.phpunit.result.cache
/.phpunit.result.cache
/.phpunit.cache/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Coverage Status](https://img.shields.io/codecov/c/github/dereuromark/cakephp-queue/master.svg)](https://codecov.io/github/dereuromark/cakephp-queue/branch/master)
[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-queue/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-queue)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)
[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat)](https://phpstan.org/)
[![License](https://poser.pugx.org/dereuromark/cakephp-queue/license)](https://packagist.org/packages/dereuromark/cakephp-queue)
[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-queue/d/total)](https://packagist.org/packages/dereuromark/cakephp-queue)
[![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)
Expand Down
18 changes: 18 additions & 0 deletions config/Migrations/202311128071500_MigrationAddIndex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Phinx\Migration\AbstractMigration;

class MigrationAddIndex extends AbstractMigration {

/**
* @return void
*/
public function change() {
$table = $this->table('queued_jobs');
$table
->addIndex('completed')
->addIndex('job_task')
->update();
}

}
13 changes: 8 additions & 5 deletions src/Controller/Admin/QueueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ public function index() {
$tasks = $taskFinder->all();
$addableTasks = $taskFinder->allAddable(AddFromBackendInterface::class);

$servers = $QueueProcesses->find()->distinct(['server'])->find(
'list',
keyField: 'server',
valueField: 'server',
)->toArray();
$servers = $QueueProcesses->find()
->distinct(['server'])
->where(['server IS NOT' => null])
->find(
'list',
keyField: 'server',
valueField: 'server',
)->toArray();
$this->set(compact('new', 'current', 'data', 'pendingDetails', 'status', 'tasks', 'addableTasks', 'servers'));
}

Expand Down
2 changes: 0 additions & 2 deletions tests/TestCase/Controller/Admin/QueueControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public function testLoadHelpers(): void {
* @return void
*/
public function testIndex() {
$this->skipIf(true, 'Needs fixing');

$this->get(['prefix' => 'Admin', 'plugin' => 'Queue', 'controller' => 'Queue', 'action' => 'index']);

$this->assertResponseCode(200);
Expand Down

0 comments on commit 3e6f21b

Please sign in to comment.