update usage worker and hook

This commit is contained in:
Damodar Lohani
2023-07-09 09:40:38 +00:00
parent 6017389351
commit 423a323d9f
5 changed files with 12 additions and 7 deletions
+3
View File
@@ -274,6 +274,9 @@ $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
// $worker->workerStart()
// ->action(function () use ($workerName) {
// Console::info("Worker $workerName started");
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/sh
QUEUE=v1-usage php /usr/src/code/app/workers/usage.php $@
php /usr/src/code/app/worker.php usage $@
Generated
+4 -4
View File
@@ -1950,12 +1950,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/platform.git",
"reference": "fa29008a786800821f35579c043e29072bcd614a"
"reference": "e770add70a6fcdd4757dd5b0e58470ff67aaf0e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/fa29008a786800821f35579c043e29072bcd614a",
"reference": "fa29008a786800821f35579c043e29072bcd614a",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/e770add70a6fcdd4757dd5b0e58470ff67aaf0e2",
"reference": "e770add70a6fcdd4757dd5b0e58470ff67aaf0e2",
"shasum": ""
},
"require": {
@@ -1992,7 +1992,7 @@
"issues": "https://github.com/utopia-php/platform/issues",
"source": "https://github.com/utopia-php/platform/tree/integrate-workers-dl"
},
"time": "2023-07-09T09:26:28+00:00"
"time": "2023-07-09T09:39:11+00:00"
},
{
"name": "utopia-php/pools",
+3 -1
View File
@@ -13,6 +13,7 @@ use Appwrite\Platform\Workers\Functions;
use Appwrite\Platform\Workers\Builds;
use Appwrite\Platform\Workers\Deletes;
use Appwrite\Platform\Workers\Usage;
use Appwrite\Platform\Workers\UsageHook;
class Workers extends Service
{
@@ -29,7 +30,8 @@ class Workers extends Service
->addAction(Functions::getName(), new Functions())
->addAction(Builds::getName(), new Builds())
->addAction(Deletes::getName(), new Deletes())
//->addAction(Usage::getName(), new Usage())
->addAction(Usage::getName(), new Usage())
->addAction(UsageHook::getName(), new UsageHook())
;
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ class UsageHook extends Usage {
public static function getName(): string
{
return 'usage';
return 'usageHook';
}
public function action($register, $cache, $pools): void