Commit 747ce77c169ce3ef5117992c98a66c9a89639533

Authored by totoro
1 parent 45ddb5e9

make timeout more longer and log error query

Showing 1 changed file with 8 additions and 6 deletions   Show diff stats
database/db_utils.anubis
@@ -72,8 +72,8 @@ public define Result(DbError, One) @@ -72,8 +72,8 @@ public define Result(DbError, One)
72 ok(_,cursor,_) then success(unique) 72 ok(_,cursor,_) then success(unique)
73 }, 73 },
74 success( (DbError err) |-> logError("DB", db_error(err,message))), 74 success( (DbError err) |-> logError("DB", db_error(err,message))),
75 - 60000, // max 60s  
76 - 100, // retry every 100 ms 75 + 600000, // max 600s
  76 + 200, // retry every 100 ms
77 (DbError _) |-> false 77 (DbError _) |-> false
78 ) is 78 ) is
79 { 79 {
@@ -145,9 +145,10 @@ public define SQLite3QueryResult @@ -145,9 +145,10 @@ public define SQLite3QueryResult
145 with t0 = unow, 145 with t0 = unow,
146 if sql_query_timeout(db, sql_query, initial_bindings, 120, 100) is 146 if sql_query_timeout(db, sql_query, initial_bindings, 120, 100) is
147 { 147 {
148 - error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/); 148 + error(sql_error) then
  149 + logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/);
149 //println(" executing [" + sql_query + "]"); 150 //println(" executing [" + sql_query + "]");
150 - //__logQueries(t0, sql_query, msg); 151 + __logQueries(t0, "[sql_query_timeout Error] "+sql_query, msg);
151 __logLongQueries(t0, sql_query, msg); 152 __logLongQueries(t0, sql_query, msg);
152 error(sql_error), 153 error(sql_error),
153 ok(headers, cursor, reset) then 154 ok(headers, cursor, reset) then
@@ -177,9 +178,10 @@ public define SQLite3Row @@ -177,9 +178,10 @@ public define SQLite3Row
177 with t0 = unow, 178 with t0 = unow,
178 if sql_query_statement_timeout(sql_command_stmt, initial_bindings, 120, 100, msg) is 179 if sql_query_statement_timeout(sql_command_stmt, initial_bindings, 120, 100, msg) is
179 { 180 {
180 - error(sql_error) then logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/); 181 + error(sql_error) then
  182 + logError("DB", db_error(sql_error,msg) /*+ " executing [" + sql_query + "]"*/);
181 //println(" executing [" + sql_command_stmt + "]"); 183 //println(" executing [" + sql_command_stmt + "]");
182 - //__logQueries(t0, "stmt", msg); 184 + __logQueries(t0, "[sql_query_statement_timeout Error]", msg);
183 __logLongQueries(t0, "stmt", msg); 185 __logLongQueries(t0, "stmt", msg);
184 error(sql_error), 186 error(sql_error),
185 no_more_row then 187 no_more_row then