From 45532ed0bf54a8a1a0e353799819a68f7be43bdf Mon Sep 17 00:00:00 2001 From: Luciano Righetti Date: Mon, 22 Nov 2021 09:49:34 +0100 Subject: [PATCH 1/2] fix: ServerShell fails if SimpleBackgroundJobs config does not exists --- app/Console/Command/ServerShell.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/Console/Command/ServerShell.php b/app/Console/Command/ServerShell.php index 183ff901c..21f8272b8 100644 --- a/app/Console/Command/ServerShell.php +++ b/app/Console/Command/ServerShell.php @@ -12,17 +12,8 @@ require_once 'AppShell.php'; */ class ServerShell extends AppShell { - /** @var BackgroundJobsTool */ - private $BackgroundJobsTool; - public $uses = array('Server', 'Task', 'Job', 'User', 'Feed'); - public function initialize(): void - { - parent::initialize(); - $this->BackgroundJobsTool = new BackgroundJobsTool(Configure::read('SimpleBackgroundJobs')); - } - public function list() { $servers = $this->Server->find('all', [ @@ -89,7 +80,7 @@ class ServerShell extends AppShell foreach ($servers as $serverId => $serverName) { - $backgroundJobId = $this->BackgroundJobsTool->enqueue( + $backgroundJobId = $this->Server->getBackgroundJobsTool()->enqueue( BackgroundJobsTool::DEFAULT_QUEUE, BackgroundJobsTool::CMD_SERVER, [ @@ -199,7 +190,7 @@ class ServerShell extends AppShell foreach ($servers as $serverId => $serverName) { - $jobId = $this->BackgroundJobsTool->enqueue( + $jobId = $this->Server->getBackgroundJobsTool()->enqueue( BackgroundJobsTool::DEFAULT_QUEUE, BackgroundJobsTool::CMD_SERVER, [ @@ -319,7 +310,7 @@ class ServerShell extends AppShell foreach ($servers as $serverId => $serverName) { - $jobId = $this->BackgroundJobsTool->enqueue( + $jobId = $this->Server->getBackgroundJobsTool()->enqueue( BackgroundJobsTool::DEFAULT_QUEUE, BackgroundJobsTool::CMD_SERVER, [ From cd9efaed5402ae0850b4ba081144df857cbce63e Mon Sep 17 00:00:00 2001 From: Luciano Righetti Date: Mon, 22 Nov 2021 10:36:49 +0100 Subject: [PATCH 2/2] fix: update dep for fixing php74 build --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51b148441..bc2b3f849 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,6 +71,8 @@ jobs: LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y sudo apt-get -y install curl python3 python3-zmq python3-requests python3-pip python3-nose python3-redis python3-lxml apache2 libapache2-mod-php$php_version libfuzzy-dev sudo pip3 install virtualenv # virtualenv must be instaled from pip and not from ubuntu packages + # hotfix due to: https://bugs.php.net/bug.php?id=81640 TODO: remove after libpcre2-8-0:10.36 gets to stable channel + sudo apt install --only-upgrade libpcre2-8-0 curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - sudo chown $USER:www-data $HOME/.composer pushd app