[bugfix] Sqlite transaction escalation was causing errors (#6299)
* well that was an easy fix * change fn name because somebody wasn't happy about my one line fix
This commit is contained in:
@@ -40,8 +40,11 @@ impl SqliteEcashTicketbookManager {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn begin_storage_tx(&self) -> Result<Transaction<'_, Sqlite>, sqlx::Error> {
|
||||
self.connection_pool.begin().await
|
||||
/// Starts a write (IMMEDIATE) transaction, to prevent issue when upgrading from a read one to a write one
|
||||
pub(crate) async fn begin_storage_write_tx(
|
||||
&self,
|
||||
) -> Result<Transaction<'_, Sqlite>, sqlx::Error> {
|
||||
self.connection_pool.begin_with("BEGIN IMMEDIATE").await
|
||||
}
|
||||
|
||||
pub(crate) async fn insert_pending_ticketbook(
|
||||
|
||||
@@ -244,7 +244,7 @@ impl Storage for PersistentStorage {
|
||||
tickets: u32,
|
||||
) -> Result<Option<RetrievedTicketbook>, Self::StorageError> {
|
||||
let deadline = ecash_today().ecash_date();
|
||||
let mut tx = self.storage_manager.begin_storage_tx().await?;
|
||||
let mut tx = self.storage_manager.begin_storage_write_tx().await?;
|
||||
|
||||
// we don't want ticketbooks with expiration in the past
|
||||
let Some(raw) =
|
||||
|
||||
Reference in New Issue
Block a user