Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Oct 12, 2023
1 parent 7a78f49 commit 69abd22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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=[email protected]
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=[email protected]
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,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
Expand Down
11 changes: 3 additions & 8 deletions src/Appwrite/Event/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ class Database extends Event
public function __construct(protected Connection $connection)
{
parent::__construct($connection);
$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);
$this
->setQueue($this->getProject()->getAttribute('database'))
->setClass(Event::DATABASE_CLASS_NAME);
}

/**
Expand Down

0 comments on commit 69abd22

Please sign in to comment.