From 82cbbe1829b15dcf3884b33be739133127e8c364 Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Mon, 2 Feb 2026 07:28:42 +0100 Subject: [PATCH] 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 Signed-off-by: Simon L. --- php/src/Controller/ConfigurationController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/src/Controller/ConfigurationController.php b/php/src/Controller/ConfigurationController.php index bb55e10f..c40ee98c 100644 --- a/php/src/Controller/ConfigurationController.php +++ b/php/src/Controller/ConfigurationController.php @@ -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(); } } }