mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Wrap ConfigurationController#SetConfig into a "transaction"
This avoids a lot of subsequent writes and reads from the file system, because now only commitTransaction() actually writes the config file. Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
4ecb870885
commit
82cbbe1829
1 changed files with 3 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ readonly class ConfigurationController {
|
|||
|
||||
public function SetConfig(Request $request, Response $response, array $args): Response {
|
||||
try {
|
||||
$this->configurationManager->startTransaction();
|
||||
if (isset($request->getParsedBody()['domain'])) {
|
||||
$domain = $request->getParsedBody()['domain'] ?? '';
|
||||
$skipDomainValidation = isset($request->getParsedBody()['skip_domain_validation']);
|
||||
|
|
@ -137,6 +138,8 @@ readonly class ConfigurationController {
|
|||
} catch (InvalidSettingConfigurationException $ex) {
|
||||
$response->getBody()->write($ex->getMessage());
|
||||
return $response->withStatus(422);
|
||||
} finally {
|
||||
$this->configurationManager->commitTransaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue