Do not create threadpools if we won't need them

This commit is contained in:
John Sully committed 2024-03-01 22:19:25 +00:00
1 parent c08683e920
commit 260f47bbb5
1 file changed
+8 -3
+8 -3
View File
@@ -4159,10 +4159,15 @@ void InitServerLast() {
g_pserver->asyncworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads);
g_pserver->asyncreadworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads*10);
if (g_pserver->m_pstorageFactory != nullptr) {
g_pserver->asyncreadworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads);
//Process one write/commit at a time to ensure consistency
g_pserver->asyncwriteworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(1);
//Process one write/commit at a time to ensure consistency
g_pserver->asyncwriteworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(1);
} else {
g_pserver->asyncreadworkqueue = nullptr;
g_pserver->asyncwriteworkqueue = nullptr;
}
// Allocate the repl backlog