mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
refactor(src/config): poll convars
This commit is contained in:
1 parent
1544bc3e48
commit
b5190f98e9
1 file changed
+17
-7
+17
-7
@@ -1,16 +1,26 @@
|
||||
export const resourceName = GetCurrentResourceName();
|
||||
export const mysql_ui = GetConvar('mysql_ui', 'false') === 'true';
|
||||
export const mysql_slow_query_warning = GetConvarInt('mysql_slow_query_warning', 200);
|
||||
export const mysql_connection_string = GetConvar('mysql_connection_string', '');
|
||||
export let mysql_ui = GetConvar('mysql_ui', 'false') === 'true';
|
||||
export let mysql_slow_query_warning = GetConvarInt('mysql_slow_query_warning', 200);
|
||||
export let mysql_debug: boolean | string[];
|
||||
|
||||
try {
|
||||
const debug = GetConvar('mysql_debug', 'false');
|
||||
mysql_debug = debug === 'false' ? false : JSON.parse(debug);
|
||||
} catch (e) {
|
||||
mysql_debug = true;
|
||||
function setDebug() {
|
||||
try {
|
||||
const debug = GetConvar('mysql_debug', 'false');
|
||||
mysql_debug = debug === 'false' ? false : JSON.parse(debug);
|
||||
} catch (e) {
|
||||
mysql_debug = true;
|
||||
}
|
||||
}
|
||||
|
||||
setDebug();
|
||||
|
||||
setInterval(() => {
|
||||
setDebug();
|
||||
mysql_ui = GetConvar('mysql_ui', 'false') === 'true';
|
||||
mysql_slow_query_warning = GetConvarInt('mysql_slow_query_warning', 200);
|
||||
}, 1000);
|
||||
|
||||
export const mysql_transaction_isolation_level = (() => {
|
||||
const query = 'SET TRANSACTION ISOLATION LEVEL';
|
||||
switch (GetConvarInt('mysql_transaction_isolation_level', 2)) {
|
||||
|
||||
Reference in new issue
Block a user