From 0ccad7481020ce7919669ede385781e95028d8f3 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 14 Feb 2024 03:44:52 +0100 Subject: [PATCH] Even less conflicts --- src/Core/ServerUUID.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Core/ServerUUID.cpp b/src/Core/ServerUUID.cpp index bcc1fecb529..c2de6be7794 100644 --- a/src/Core/ServerUUID.cpp +++ b/src/Core/ServerUUID.cpp @@ -14,6 +14,11 @@ namespace ErrorCodes } void ServerUUID::load(const fs::path & server_uuid_file, Poco::Logger * log) +{ + server_uuid = loadServerUUID(server_uuid_file, log); +} + +UUID loadServerUUID(const fs::path & server_uuid_file, Poco::Logger * log) { /// Write a uuid file containing a unique uuid if the file doesn't already exist during server start. @@ -25,8 +30,7 @@ void ServerUUID::load(const fs::path & server_uuid_file, Poco::Logger * log) ReadBufferFromFile in(server_uuid_file); readUUIDText(uuid, in); assertEOF(in); - server_uuid = uuid; - return; + return uuid; } catch (...) { @@ -44,7 +48,7 @@ void ServerUUID::load(const fs::path & server_uuid_file, Poco::Logger * log) out.write(uuid_str.data(), uuid_str.size()); out.sync(); out.finalize(); - server_uuid = new_uuid; + return new_uuid; } catch (...) {