Commit 27c7ece086a907734206e8678f884c3830c8be84

Authored by Cédric RICARD
1 parent ead0383b

Fix transaction

Showing 1 changed file with 3 additions and 11 deletions   Show diff stats
calexium_lib/database/db_utils.anubis
... ... @@ -56,7 +56,8 @@ public define Result(SQLite3Error, One)
56 56 ok(cursor) then success(unique)
57 57 },
58 58 success( (SQLite3Error err) |-> logError("DB", db_error(err,message))),
59   - 60000 // max 60s
  59 + 60000, // max 60s
  60 + 100 // retry every 100 ms
60 61 ) is
61 62 {
62 63 error(err_and_result) then
... ... @@ -68,16 +69,7 @@ public define Result(SQLite3Error, One)
68 69 ok(unique)
69 70 }.
70 71  
71   - public define Maybe(SQLite3HeadersOrRow -> SQLite3Row)
72   - sql_query_timeout
73   - (
74   - SQLite3DataBase db, //database handle
75   - String sql_query, //sql query itself
76   - String msg //message to be shown if an error occure
77   - ) =
78   - //we try with 30 sec of timeout
79   - sql_query_timeout(db, sql_query, now + 30, msg).
80   -
  72 +
81 73 public define Maybe(SQLite3HeadersOrRow -> SQLite3Row)
82 74 sql_query_timeout
83 75 (
... ...