database/middleware: do not recover/panic in defer
defer always runs after a panic. There is no need to recover and
re-panic, we can just unconditionally tx.Rollback() (it will
silently error out if the transaction has already been committed or
rolled back).
This fixes the stack trace of the panic being incorrect. It points
to this function instead of the real culprit.
database: panic on errors from Commit/Rollback
The previous change would eat the error from fn(tx); in truth we should
ensure that it is returned to the caller. This panics instead if an
error occurs during Commit or Rollback. I'm not sure of what scenarios
would cause this to occur, but they all probably deserve further
investigation - a panic will raise it to our attention.
database: handle Commit/Rollback errors
database.WithTx: rollback if func returns error
Previously, this only rolled back if the called function panicked. This
updates it to also roll back if the called function returns an error.
Expand context for work queues
Import GQL server interfaces from gql.sr.ht