Karmator
Karmator copied to clipboard
Robustify the sql layer, an sql error killed the bot.
[Debug#SQL] "INSERT INTO \"votes\"(\"voted_at\",\"by_whom_name\",\"for_what_name\",\"amount\") VALUES(?,?,?,?)" [PersistUTCTime 2015-06-29 21:47:43.445417 UTC,PersistText "PBERENS",PersistText "a",PersistInt64 1] @(persistent-2.1.1:Database.Persist.Sql.Raw ./Database/Persist/Sql/Raw.hs:55:18)
karmator: user error (SQLite3 returned ErrorBusy while attempting to perform step.)
Basically a good way to test is to have two instance of the bot using the same database, then both will write at almost the same moment which would trigger this to kill the original bot.
Oh this is sqlbusy, that's by concurrent sqlite access, should not typically be a thing unless i am operating on the db via sqlite cli, but outside of that domain, the sql layer is single threaded so it shouldn't ever run into this practically.