core: remove connection pool (#738)

* core: remove connection pool

* remove local ref from cabal.project

* update simplexmq

* log test

* fix test
This commit is contained in:
Evgeny Poberezkin
2022-06-16 20:00:51 +01:00
committed by GitHub
parent 1f1ed3f3dd
commit c62d99ab97
13 changed files with 15 additions and 15 deletions
-1
View File
@@ -56,7 +56,6 @@ updateStr = "To update run: curl -o- https://raw.githubusercontent.com/simplex-c
data ChatConfig = ChatConfig
{ agentConfig :: AgentConfig,
dbPoolSize :: Int,
yesToMigrations :: Bool,
defaultServers :: InitialAgentServers,
tbqSize :: Natural,
+2 -2
View File
@@ -15,7 +15,7 @@ import Simplex.Chat.Types
import UnliftIO.Async
simplexChatCore :: ChatConfig -> ChatOpts -> Maybe (Notification -> IO ()) -> (User -> ChatController -> IO ()) -> IO ()
simplexChatCore cfg@ChatConfig {dbPoolSize, yesToMigrations} opts sendToast chat
simplexChatCore cfg@ChatConfig {yesToMigrations} opts sendToast chat
| logAgent opts = do
setLogLevel LogInfo -- LogError
withGlobalLogging logCfg initRun
@@ -23,7 +23,7 @@ simplexChatCore cfg@ChatConfig {dbPoolSize, yesToMigrations} opts sendToast chat
where
initRun = do
let f = chatStoreFile $ dbFilePrefix opts
st <- createStore f dbPoolSize yesToMigrations
st <- createStore f yesToMigrations
u <- getCreateActiveUser st
cc <- newChatController st (Just u) cfg opts sendToast
runSimplexChat opts u cc chat
+1 -1
View File
@@ -90,7 +90,7 @@ getActiveUser_ st = find activeUser <$> getUsers st
chatInit :: String -> IO ChatController
chatInit dbFilePrefix = do
let f = chatStoreFile dbFilePrefix
chatStore <- createStore f (dbPoolSize defaultMobileConfig) (yesToMigrations (defaultMobileConfig :: ChatConfig))
chatStore <- createStore f (yesToMigrations (defaultMobileConfig :: ChatConfig))
user_ <- getActiveUser_ chatStore
newChatController chatStore user_ defaultMobileConfig mobileChatOpts {dbFilePrefix} Nothing
+2 -2
View File
@@ -237,8 +237,8 @@ migrations = sortBy (compare `on` name) $ map migration schemaMigrations
where
migration (name, query) = Migration {name = name, up = fromQuery query}
createStore :: FilePath -> Int -> Bool -> IO SQLiteStore
createStore dbFilePath poolSize = createSQLiteStore dbFilePath poolSize migrations
createStore :: FilePath -> Bool -> IO SQLiteStore
createStore dbFilePath = createSQLiteStore dbFilePath migrations
chatStoreFile :: FilePath -> FilePath
chatStoreFile = (<> "_chat.db")