diff --git a/code/controllers/configuration/entries/dbconfig.dm b/code/controllers/configuration/entries/dbconfig.dm index 72f190c2f17..b0341952414 100644 --- a/code/controllers/configuration/entries/dbconfig.dm +++ b/code/controllers/configuration/entries/dbconfig.dm @@ -44,4 +44,8 @@ min_val = 0 protection = CONFIG_ENTRY_LOCKED +/datum/config_entry/number/bsql_thread_limit + config_entry_value = 50 + min_val = 1 + /datum/config_entry/flag/bsql_debug diff --git a/code/controllers/subsystem/dbcore.dm b/code/controllers/subsystem/dbcore.dm index b445056e761..6309d46020f 100644 --- a/code/controllers/subsystem/dbcore.dm +++ b/code/controllers/subsystem/dbcore.dm @@ -76,7 +76,7 @@ SUBSYSTEM_DEF(dbcore) var/address = CONFIG_GET(string/address) var/port = CONFIG_GET(number/port) - connection = new /datum/BSQL_Connection(BSQL_CONNECTION_TYPE_MARIADB, CONFIG_GET(number/async_query_timeout), CONFIG_GET(number/blocking_query_timeout)) + connection = new /datum/BSQL_Connection(BSQL_CONNECTION_TYPE_MARIADB, CONFIG_GET(number/async_query_timeout), CONFIG_GET(number/blocking_query_timeout), CONFIG_GET(number/bsql_thread_limit)) var/error if(QDELETED(connection)) connection = null diff --git a/config/dbconfig.txt b/config/dbconfig.txt index 35f599261ef..3a058fe5632 100644 --- a/config/dbconfig.txt +++ b/config/dbconfig.txt @@ -38,5 +38,8 @@ ASYNC_QUERY_TIMEOUT 10 ## Must be less than or equal to ASYNC_QUERY_TIMEOUT BLOCKING_QUERY_TIMEOUT 5 +## The maximum number of additional threads BSQL is allowed to run at once +BSQL_THREAD_LIMIT 50 + ## Uncomment to enable verbose BSQL communication logs #BSQL_DEBUG