Hi, when "dbi_connect" tries to connect to my database it lags the server so bad for 45+ seconds that you think the server crashed. Here is the code that is used, and maybe someone can help me fix this, or maybe there isn't a way to fix it.
Code:
new Sql:dbcSkills
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(7.0, "sql_init_db")
return PLUGIN_CONTINUE
}
public sql_init_db() {
// Connect to the database
new host[64], username[32], password[32], dbname[32], error[32]
get_cvar_string("amx_sql_host", host, 64)
get_cvar_string("amx_sql_user", username, 32)
get_cvar_string("amx_sql_pass", password, 32)
get_cvar_string("amx_sql_db", dbname, 32)
dbcSkills = dbi_connect(host, username, password, dbname, error, 32)
return PLUGIN_CONTINUE
}
After 45+ seconds of major lag, it starts going again (it does connect to the database).