From cf302333581d5e9ea357aee4a85d5417e95afddc Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 27 Apr 2022 15:23:28 +0200 Subject: [PATCH] Prefix env variable name with `KIWIX_` --- src/library.cpp | 8 ++++---- src/server/internalServer.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index 7c5a63562..d4b933c4d 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -108,8 +108,8 @@ struct Library::Impl }; Library::Impl::Impl() - : mp_archiveCache(new ArchiveCache(std::max(getEnvVar("ARCHIVE_CACHE_SIZE", 1), 1))), - mp_searcherCache(new SearcherCache(std::max(getEnvVar("SEARCHER_CACHE_SIZE", 1), 1))), + : mp_archiveCache(new ArchiveCache(std::max(getEnvVar("KIWIX_ARCHIVE_CACHE_SIZE", 1), 1))), + mp_searcherCache(new SearcherCache(std::max(getEnvVar("KIWIX_SEARCHER_CACHE_SIZE", 1), 1))), m_bookDB("", Xapian::DB_BACKEND_INMEMORY) { } @@ -176,10 +176,10 @@ bool Library::addBook(const Book& book) static_cast(newEntry) = book; newEntry.lastUpdatedRevision = mp_impl->m_revision; size_t new_cache_size = std::ceil(mp_impl->getBookCount(true, true)*0.1); - if (getEnvVar("ARCHIVE_CACHE_SIZE", -1) <= 0) { + if (getEnvVar("KIWIX_ARCHIVE_CACHE_SIZE", -1) <= 0) { mp_impl->mp_archiveCache->setMaxSize(new_cache_size); } - if (getEnvVar("SEARCHER_CACHE_SIZE", -1) <= 0) { + if (getEnvVar("KIWIX_SEARCHER_CACHE_SIZE", -1) <= 0) { mp_impl->mp_searcherCache->setMaxSize(new_cache_size); } return true; diff --git a/src/server/internalServer.cpp b/src/server/internalServer.cpp index b667d47b9..6548a2468 100644 --- a/src/server/internalServer.cpp +++ b/src/server/internalServer.cpp @@ -329,8 +329,8 @@ InternalServer::InternalServer(Library* library, mp_daemon(nullptr), mp_library(library), mp_nameMapper(nameMapper ? nameMapper : &defaultNameMapper), - searchCache(getEnvVar("SEARCH_CACHE_SIZE", DEFAULT_CACHE_SIZE)), - suggestionSearcherCache(getEnvVar("SUGGESTION_SEARCHER_CACHE_SIZE", std::max((unsigned int) (mp_library->getBookCount(true, true)*0.1), 1U))) + searchCache(getEnvVar("KIWIX_SEARCH_CACHE_SIZE", DEFAULT_CACHE_SIZE)), + suggestionSearcherCache(getEnvVar("KIWIX_SUGGESTION_SEARCHER_CACHE_SIZE", std::max((unsigned int) (mp_library->getBookCount(true, true)*0.1), 1U))) {} bool InternalServer::start() {