Add Max Concurrent Connections for database users
Closes #1849 Allows database users to be limited to a number of concurrent connections to prevent one user from connecting hundreds of time and bottlenecking the MySQL server.
This commit is contained in:
parent
2c3a9228ec
commit
f0e4764a11
10 changed files with 56 additions and 6 deletions
|
@ -84,7 +84,8 @@ class DatabaseManagementService
|
|||
$this->repository->createUser(
|
||||
$database->username,
|
||||
$database->remote,
|
||||
$this->encrypter->decrypt($database->password)
|
||||
$this->encrypter->decrypt($database->password),
|
||||
$database->max_connections
|
||||
);
|
||||
$this->repository->assignUserToDatabase(
|
||||
$database->database,
|
||||
|
|
|
@ -71,7 +71,7 @@ class DatabasePasswordService
|
|||
]);
|
||||
|
||||
$this->repository->dropUser($database->username, $database->remote);
|
||||
$this->repository->createUser($database->username, $database->remote, $password);
|
||||
$this->repository->createUser($database->username, $database->remote, $password, $database->max_connections);
|
||||
$this->repository->assignUserToDatabase($database->database, $database->username, $database->remote);
|
||||
$this->repository->flush();
|
||||
});
|
||||
|
|
Reference in a new issue