From 10c6ae778724e5c15a12b58bc95c814cb17b772e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Tue, 8 Apr 2025 16:59:48 +0200
Subject: [PATCH 37/44] don't create throwaway sysrepo sessions during startup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Wires

Change-Id: Ic3fc71c08c589a8e87bbdc1aa1b1089c88c7cb1e
Signed-off-by: Mattias Walström <lazzer@gmail.com>
---
 src/restconf/Server.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/restconf/Server.cpp b/src/restconf/Server.cpp
index 9fd3fa9..a840e6e 100644
--- a/src/restconf/Server.cpp
+++ b/src/restconf/Server.cpp
@@ -847,7 +847,7 @@ Server::Server(sysrepo::Connection conn, const std::string& address, const std::
              {"ietf-subscribed-notifications", "2019-09-09", {}},
              {"ietf-restconf-subscribed-notifications", "2019-11-17", {}},
          }) {
-        if (auto mod = conn.sessionStart().getContext().getModuleImplemented(module)) {
+        if (auto mod = m_monitoringSession.getContext().getModuleImplemented(module)) {
             for (const auto& feature : features) {
                 if (!mod->featureEnabled(feature)) {
                     throw std::runtime_error("Module "s + module + "@" + version + " does not implement feature " + feature);
-- 
2.43.0

