core: option to limit the max number of loaded chats (#7499)

* core: option to limit the max number of loaded chats

* update bot api

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny
2026-09-13 12:23:39 +01:00
committed by GitHub
co-authored by Evgeny @ SimpleX Chat
parent be673038ab
commit ca114a7a2a
11 changed files with 52 additions and 15 deletions
+11
View File
@@ -67,6 +67,7 @@ data CoreChatOpts = CoreChatOpts
logAgent :: Maybe LogLevel,
logFile :: Maybe FilePath,
tbqSize :: Natural,
maxChats :: Int,
deviceName :: Maybe Text,
chatRelay :: Bool,
webPreviewConfig :: Maybe WebPreviewConfig,
@@ -234,6 +235,15 @@ coreChatOptsP appDir defaultDbName = do
<> value 1024
<> showDefault
)
maxChats <-
option
auto
( long "max-chats"
<> metavar "COUNT"
<> help "Max number of chats loaded by chat list API"
<> value 5000
<> showDefault
)
deviceName <-
optional $
strOption
@@ -340,6 +350,7 @@ coreChatOptsP appDir defaultDbName = do
logAgent = if logAgent || logLevel == CLLDebug then Just $ agentLogLevel logLevel else Nothing,
logFile,
tbqSize,
maxChats,
deviceName,
chatRelay,
webPreviewConfig,