mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat(worker): install stop hooks and close consumer
This commit is contained in:
+11
-2
@@ -18,7 +18,9 @@ use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Platform\Appwrite;
|
||||
use Executor\Executor;
|
||||
use Swoole\Process;
|
||||
use Swoole\Runtime;
|
||||
use Swoole\Timer;
|
||||
use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis;
|
||||
use Utopia\Cache\Adapter\Pool as CachePool;
|
||||
use Utopia\Cache\Adapter\Sharding;
|
||||
@@ -480,8 +482,15 @@ $worker
|
||||
});
|
||||
|
||||
$worker->workerStart()
|
||||
->action(function () use ($workerName) {
|
||||
Console::info("Worker $workerName started");
|
||||
->action(function () use ($worker, $workerName) {
|
||||
Console::info("Worker $workerName started");
|
||||
|
||||
Process::signal(SIGTERM, function () use ($worker, $workerName) {
|
||||
Console::info("Stopping worker $workerName.");
|
||||
|
||||
$worker->stop();
|
||||
Timer::clearAll();
|
||||
});
|
||||
});
|
||||
|
||||
$worker->start();
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
php /usr/src/code/app/cli.php screenshot $@
|
||||
exec php /usr/src/code/app/cli.php screenshot $@
|
||||
Generated
+6
-6
@@ -4264,16 +4264,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/queue",
|
||||
"version": "0.11.0",
|
||||
"version": "0.11.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/queue.git",
|
||||
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5"
|
||||
"reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/queue/zipball/06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
|
||||
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
|
||||
"url": "https://api.github.com/repos/utopia-php/queue/zipball/498bbbef418b1db71b51e1bb62f5d1d752ddd8d6",
|
||||
"reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4324,9 +4324,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/queue/issues",
|
||||
"source": "https://github.com/utopia-php/queue/tree/0.11.0"
|
||||
"source": "https://github.com/utopia-php/queue/tree/0.11.1"
|
||||
},
|
||||
"time": "2025-05-30T09:52:38+00:00"
|
||||
"time": "2025-05-30T11:50:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/registry",
|
||||
|
||||
Reference in New Issue
Block a user