1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

small adjustments

This commit is contained in:
shimon 2023-07-12 11:12:56 +03:00
parent 58aa29a4ae
commit d1d1392bb3
5 changed files with 28 additions and 25 deletions

View file

@ -5,13 +5,6 @@ require_once __DIR__ . '/controllers/general.php';
use Appwrite\Event\Delete;
use Appwrite\Event\Certificate;
use Appwrite\Event\Database as EventDatabase;
use Appwrite\Event\Func;
use Appwrite\Event\Audit;
use Appwrite\Event\Build;
use Appwrite\Event\Event;
use Appwrite\Event\Mail;
use Appwrite\Event\Phone;
use Appwrite\Platform\Appwrite;
use Utopia\CLI\CLI;
use Utopia\Database\Validator\Authorization;
@ -26,7 +19,6 @@ use Utopia\Database\Document;
use Utopia\Logger\Log;
use Utopia\Pools\Group;
use Utopia\Queue\Connection;
use Utopia\Queue\Server;
use Utopia\Registry\Registry;
Authorization::disable();

View file

@ -152,11 +152,11 @@ Server::setResource('queueForCertificates', function (Connection $queue) {
Server::setResource('queueForUsage', function (Connection $queue) {
return new Usage($queue);
}, ['queue']);
Server::setResource('logger', function ($register) {
Server::setResource('logger', function (Registry $register) {
return $register->get('logger');
}, ['register']);
Server::setResource('pools', function ($register) {
Server::setResource('pools', function (Registry $register) {
return $register->get('pools');
}, ['register']);
@ -274,12 +274,13 @@ $worker
Console::error('[Error] Line: ' . $error->getLine());
});
// We need to add `getWorkerStartHook` in `utopia-php/queue` so that we can check if
// we have already added workerStart hook, if not we can add this default worker start hook here
try {
$workerStart = $worker->getWorkerStart();
} catch (\Throwable $error) {
$worker->workerStart()
->action(function () use ($workerName) {
Console::info("Worker $workerName started");
});
}
// $worker->workerStart()
// ->action(function () use ($workerName) {
// Console::info("Worker $workerName started");
// });
$worker->start();

View file

@ -50,7 +50,7 @@
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.30.*",
"utopia-php/queue": "0.5.*",
"utopia-php/queue": "dev-feat-get-worker-start as 0.5.3",
"utopia-php/orchestration": "0.9.*",
"utopia-php/platform": "dev-integrate-workers as 0.3.3",
"utopia-php/pools": "0.4.*",

21
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "185f3be3c459767318599669f63145af",
"content-hash": "2cf09045bf1484d009c4af490ea4adba",
"packages": [
{
"name": "adhocore/jwt",
@ -2100,16 +2100,16 @@
},
{
"name": "utopia-php/queue",
"version": "0.5.3",
"version": "dev-feat-get-worker-start",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/queue.git",
"reference": "8e8b6cb27172713fe5d8b7b092ce68516caf129a"
"reference": "2a2eee58dace58e75142d9e2e26d2f5104d7f3f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/8e8b6cb27172713fe5d8b7b092ce68516caf129a",
"reference": "8e8b6cb27172713fe5d8b7b092ce68516caf129a",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/2a2eee58dace58e75142d9e2e26d2f5104d7f3f7",
"reference": "2a2eee58dace58e75142d9e2e26d2f5104d7f3f7",
"shasum": ""
},
"require": {
@ -2155,9 +2155,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/queue/issues",
"source": "https://github.com/utopia-php/queue/tree/0.5.3"
"source": "https://github.com/utopia-php/queue/tree/feat-get-worker-start"
},
"time": "2023-05-24T19:06:04+00:00"
"time": "2023-07-12T07:55:31+00:00"
},
{
"name": "utopia-php/registry",
@ -5182,10 +5182,17 @@
"version": "dev-integrate-workers",
"alias": "0.3.3",
"alias_normalized": "0.3.3.0"
},
{
"package": "utopia-php/queue",
"version": "dev-feat-get-worker-start",
"alias": "0.5.3",
"alias_normalized": "0.5.3.0"
}
],
"minimum-stability": "stable",
"stability-flags": {
"utopia-php/queue": 20,
"utopia-php/platform": 20
},
"prefer-stable": false,

View file

@ -379,6 +379,8 @@ services:
volumes:
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
- ./vendor/utopia-php/platform:/usr/src/code/vendor/utopia-php/platform
- ./vendor/utopia-php/queue:/usr/src/code/vendor/utopia-php/queue
depends_on:
- redis
- mariadb
@ -637,6 +639,7 @@ services:
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
- ./vendor/utopia-php/platform:/usr/src/code/vendor/utopia-php/platform
- ./vendor/utopia-php/queue:/usr/src/code/vendor/utopia-php/queue
depends_on:
- redis