Simplify
This commit is contained in:
parent
d238d79e29
commit
5d845208d9
4 changed files with 7 additions and 28 deletions
3
.env
3
.env
|
@ -4,8 +4,7 @@ _APP_WORKER_PER_CORE=6
|
|||
_APP_CONSOLE_WHITELIST_ROOT=disabled
|
||||
_APP_CONSOLE_WHITELIST_EMAILS=
|
||||
_APP_CONSOLE_WHITELIST_IPS=
|
||||
_APP_CONNECTIONS_QUEUE_PER_WORKER=enabled
|
||||
_APP_CONNECTIONS_DB_QUEUES=v1-database-0,v1-database-1,v1-database-2
|
||||
_APP_CONNECTIONS_DB_QUEUE=database-db-main
|
||||
_APP_SYSTEM_EMAIL_NAME=Appwrite
|
||||
_APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io
|
||||
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io
|
||||
|
|
|
@ -7,18 +7,4 @@ else
|
|||
REDIS_BACKEND="redis://${_APP_REDIS_USER}:${_APP_REDIS_PASS}@${_APP_REDIS_HOST}:${_APP_REDIS_PORT}"
|
||||
fi
|
||||
|
||||
queues="${_APP_CONNECTIONS_DB_QUEUES}"
|
||||
if [ -z "${queues}" ]; then
|
||||
queues="v1-databases"
|
||||
fi
|
||||
|
||||
count=1
|
||||
if [ "${_APP_CONNECTIONS_QUEUE_PER_WORKER}" = "enabled" ]; then
|
||||
count=$(echo "${queues}" | tr ',' '\n' | wc -l)
|
||||
fi
|
||||
|
||||
INTERVAL=0.1 \
|
||||
QUEUE="${queues}" \
|
||||
COUNT=${count} \
|
||||
APP_INCLUDE='/usr/src/code/app/workers/databases.php' \
|
||||
php /usr/src/code/vendor/bin/resque -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php
|
||||
INTERVAL=0.1 QUEUE="${_APP_CONNECTIONS_DB_QUEUE}" APP_INCLUDE="/usr/src/code/app/workers/databases.php" php /usr/src/code/vendor/bin/resque -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php
|
||||
|
|
|
@ -366,8 +366,7 @@ services:
|
|||
- mariadb
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_CONNECTIONS_QUEUE_PER_WORKER
|
||||
- _APP_CONNECTIONS_DB_QUEUES
|
||||
- _APP_CONNECTIONS_DB_QUEUE
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_REDIS_HOST
|
||||
|
|
|
@ -15,15 +15,10 @@ class Database extends Event
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$dbQueues = App::getEnv('_APP_CONNECTIONS_DB_QUEUES');
|
||||
|
||||
if (empty($dbQueues)) {
|
||||
$queue = Event::DATABASE_QUEUE_NAME;
|
||||
} else {
|
||||
$queue = $this->getProject()->getAttribute('database');
|
||||
}
|
||||
|
||||
parent::__construct($queue, Event::DATABASE_CLASS_NAME);
|
||||
parent::__construct(
|
||||
$this->getProject()->getAttribute('database'),
|
||||
Event::DATABASE_CLASS_NAME
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue