diff --git a/src/server.cpp b/src/server.cpp index 4a42df649..a14e4a9ce 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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