async fn revert_snapshot<R: Read + Seek>(
        &self,
        snapshot_tx: &mut SourceTransaction<'_>,
        mut reader: R,
    ) -> Result<(), anyhow::Error> {
        tokio::task::block_in_place(|| -> Result<(), anyhow::Error> {
            let len = reader.seek(SeekFrom::Current(0))?;
            reader.seek(SeekFrom::Start(0))?;
            let mut reader = reader.take(len);
            let handle = Handle::current();
            while reader.limit() > 0 {
                let row = bincode::deserialize_from(&mut reader)?;
                handle.block_on(snapshot_tx.delete(row))?;
            }
            Ok(())
        })
    }
/// Reverts a failed snapshot by deleting any processed rows from the dataflow.
Reverts a failed snapshot by deleting any processed rows from the dataflow.
Reverts a failed snapshot by deleting any processed rows from the dataflow .
async fn revert_snapshot<R: Read + Seek>(
        &self,
        snapshot_tx: &mut SourceTransaction<'_>,
        mut reader: R,
    ) -> Result<(), anyhow::Error> {
        tokio::task::block_in_place(|| -> Result<(), anyhow::Error> {
            let len = reader.seek(SeekFrom::Current(0))?;
            reader.seek(SeekFrom::Start(0))?;
            let mut reader = reader.take(len);
            let handle = Handle::current();
            while reader.limit() > 0 {
                let row = bincode::deserialize_from(&mut reader)?;
                handle.block_on(snapshot_tx.delete(row))?;
            }
            Ok(())
        })
    }
async fn revert_snapshot < R : Read + Seek > ( & self , snapshot_tx : & mut SourceTransaction < ' _ > , mut reader : R , ) -> Result < ( ) , anyhow :: Error > { tokio :: task :: block_in_place ( | | -> Result < ( ) , anyhow :: Error > { let len = reader . seek ( SeekFrom :: Current ( 0 ) ) ? ; reader . seek ( SeekFrom :: Start ( 0 ) ) ? ; let mut reader = reader . take ( len ) ; let handle = Handle :: current ( ) ; while reader . limit ( ) > 0 { let row = bincode :: deserialize_from ( & mut reader ) ? ; handle . block_on ( snapshot_tx . delete ( row ) ) ? ; } Ok ( ( ) ) } ) }
Reverts a failed snapshot by deleting any processed rows from the dataflow.
Reverts a failed snapshot by deleting any processed rows from the dataflow .
&self
snapshot_tx
&mut SourceTransaction<'_>
reader
R
&self
snapshot_tx
&mut SourceTransaction<'_>
reader
R