adding information about which query actually loses connection. set their priority higher. tries to re-run connection if needed
This commit is contained in:
parent
412d8589a3
commit
2d869369c3
@ -94,7 +94,7 @@ public void randomize_clantags()
|
||||
{
|
||||
char sQuery[512];
|
||||
Format(sQuery, sizeof(sQuery), "select DISTINCT tag from unloze_stats.hlstats_Clans ORDER BY RAND() limit 500");
|
||||
g_hDatabase_hlstats.Query(SQL_OnQueryCompleted_hlstats, sQuery, DBPrio_Low);
|
||||
g_hDatabase_hlstats.Query(SQL_OnQueryCompleted_hlstats, sQuery, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_OnDatabaseConnect(Database db, const char[] error, any data)
|
||||
@ -112,7 +112,7 @@ public void randomize_names()
|
||||
{
|
||||
char sQuery[512];
|
||||
Format(sQuery, sizeof(sQuery), "select name from unloze_racetimer_css.zetimer_table_new ORDER BY RAND() limit 500");
|
||||
g_hDatabase.Query(SQL_OnQueryCompleted, sQuery, DBPrio_Low);
|
||||
g_hDatabase.Query(SQL_OnQueryCompleted, sQuery, DBPrio_High);
|
||||
}
|
||||
|
||||
public void SQL_OnQueryCompleted_hlstats(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||
@ -120,7 +120,11 @@ public void SQL_OnQueryCompleted_hlstats(Database db, DBResultSet results, const
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
delete results;
|
||||
LogError("Query error 3: %s", error);
|
||||
LogError("Query error for hlstats: %s", error);
|
||||
if (!g_hDatabase_hlstats)
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect_hlstats, "hlstatsx");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -138,7 +142,11 @@ public void SQL_OnQueryCompleted(Database db, DBResultSet results, const char[]
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
delete results;
|
||||
LogError("Query error 3: %s", error);
|
||||
LogError("Query error for racetimer: %s", error);
|
||||
if (!g_hDatabase)
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect, "racetimercss");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user