diff options
author | onefang | 2020-06-01 13:25:56 +1000 |
---|---|---|
committer | onefang | 2020-06-01 13:25:56 +1000 |
commit | 3997241db3f32668b7ec4d29a597027d2c036617 (patch) | |
tree | 4f1a7c217ed0fbd6ba1519b082f9bc61d6872a1b | |
parent | Deal with the database connection going away, and various related clean ups. (diff) | |
download | opensim-SC_OLD-master.zip opensim-SC_OLD-master.tar.gz opensim-SC_OLD-master.tar.bz2 opensim-SC_OLD-master.tar.xz |
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index a8d8b3f..51f14eb 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -1095,15 +1095,14 @@ static boolean dbConnect() | |||
1095 | return FALSE; | 1095 | return FALSE; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | // Just set the fucking thing. Pffft. | 1098 | // Just set the fucking thing to a year. Pffft. |
1099 | dbTimeout = 60 * 60 * 24 * 7 * 52; | 1099 | dbTimeout = 60 * 60 * 24 * 7 * 52; |
1100 | dbTimeout = 100; | ||
1101 | char *sql = xmprintf("SET SESSION wait_timeout=%d", (int) dbTimeout); | 1100 | char *sql = xmprintf("SET SESSION wait_timeout=%d", (int) dbTimeout); |
1102 | 1101 | ||
1103 | if (mysql_query(database, sql)) | 1102 | if (mysql_query(database, sql)) |
1104 | E("SET SESSION wait_timeout=%d failed - %s", (int) dbTimeout, mysql_error(database)); | 1103 | E("SET SESSION wait_timeout=%d failed - %s", (int) dbTimeout, mysql_error(database)); |
1105 | else | 1104 | else |
1106 | D("Database wait_timeout = %d", (int) dbReconnect); | 1105 | D("Database wait_timeout = %d", (int) dbTimeout); |
1107 | free(sql); | 1106 | free(sql); |
1108 | 1107 | ||
1109 | if (-1 == clock_gettime(CLOCK_REALTIME, &dbLast)) | 1108 | if (-1 == clock_gettime(CLOCK_REALTIME, &dbLast)) |
@@ -1129,6 +1128,7 @@ static boolean dbCheckError(char *error, char *sql) | |||
1129 | if (2006 == e) | 1128 | if (2006 == e) |
1130 | { | 1129 | { |
1131 | W("Reconnecting to database."); | 1130 | W("Reconnecting to database."); |
1131 | // TODO - still failing to reconnect for dbCount() on coffeegrid. | ||
1132 | freeDb(false); | 1132 | freeDb(false); |
1133 | return dbConnect(); | 1133 | return dbConnect(); |
1134 | } | 1134 | } |