@@ -1739,40 +1739,42 @@ impl StateStore for SqliteStateStore {
1739
1739
let this = self . clone ( ) ;
1740
1740
let room_id = room_id. to_owned ( ) ;
1741
1741
1742
- self . acquire ( )
1743
- . await ?
1744
- . with_transaction ( move |txn| {
1745
- let room_info_room_id = this. encode_key ( keys:: ROOM_INFO , & room_id) ;
1746
- txn. remove_room_info ( & room_info_room_id) ?;
1742
+ let conn = self . acquire ( ) . await ?;
1747
1743
1748
- let state_event_room_id = this. encode_key ( keys:: STATE_EVENT , & room_id) ;
1749
- txn. remove_room_state_events ( & state_event_room_id, None ) ?;
1744
+ conn. with_transaction ( move |txn| -> Result < ( ) > {
1745
+ let room_info_room_id = this. encode_key ( keys:: ROOM_INFO , & room_id) ;
1746
+ txn. remove_room_info ( & room_info_room_id) ?;
1750
1747
1751
- let member_room_id = this. encode_key ( keys:: MEMBER , & room_id) ;
1752
- txn. remove_room_members ( & member_room_id , None ) ?;
1748
+ let state_event_room_id = this. encode_key ( keys:: STATE_EVENT , & room_id) ;
1749
+ txn. remove_room_state_events ( & state_event_room_id , None ) ?;
1753
1750
1754
- let profile_room_id = this. encode_key ( keys:: PROFILE , & room_id) ;
1755
- txn. remove_room_profiles ( & profile_room_id ) ?;
1751
+ let member_room_id = this. encode_key ( keys:: MEMBER , & room_id) ;
1752
+ txn. remove_room_members ( & member_room_id , None ) ?;
1756
1753
1757
- let room_account_data_room_id = this. encode_key ( keys:: ROOM_ACCOUNT_DATA , & room_id) ;
1758
- txn. remove_room_account_data ( & room_account_data_room_id ) ?;
1754
+ let profile_room_id = this. encode_key ( keys:: PROFILE , & room_id) ;
1755
+ txn. remove_room_profiles ( & profile_room_id ) ?;
1759
1756
1760
- let receipt_room_id = this. encode_key ( keys:: RECEIPT , & room_id) ;
1761
- txn. remove_room_receipts ( & receipt_room_id ) ?;
1757
+ let room_account_data_room_id = this. encode_key ( keys:: ROOM_ACCOUNT_DATA , & room_id) ;
1758
+ txn. remove_room_account_data ( & room_account_data_room_id ) ?;
1762
1759
1763
- let display_name_room_id = this. encode_key ( keys:: DISPLAY_NAME , & room_id) ;
1764
- txn. remove_room_display_names ( & display_name_room_id ) ?;
1760
+ let receipt_room_id = this. encode_key ( keys:: RECEIPT , & room_id) ;
1761
+ txn. remove_room_receipts ( & receipt_room_id ) ?;
1765
1762
1766
- let send_queue_room_id = this. encode_key ( keys:: SEND_QUEUE , & room_id) ;
1767
- txn. remove_room_send_queue ( & send_queue_room_id ) ?;
1763
+ let display_name_room_id = this. encode_key ( keys:: DISPLAY_NAME , & room_id) ;
1764
+ txn. remove_room_display_names ( & display_name_room_id ) ?;
1768
1765
1769
- let dependent_send_queue_room_id =
1770
- this. encode_key ( keys:: DEPENDENTS_SEND_QUEUE , & room_id) ;
1771
- txn. remove_room_dependent_send_queue ( & dependent_send_queue_room_id) ?;
1766
+ let send_queue_room_id = this. encode_key ( keys:: SEND_QUEUE , & room_id) ;
1767
+ txn. remove_room_send_queue ( & send_queue_room_id) ?;
1772
1768
1773
- Ok ( ( ) )
1774
- } )
1775
- . await
1769
+ let dependent_send_queue_room_id =
1770
+ this. encode_key ( keys:: DEPENDENTS_SEND_QUEUE , & room_id) ;
1771
+ txn. remove_room_dependent_send_queue ( & dependent_send_queue_room_id) ?;
1772
+
1773
+ Ok ( ( ) )
1774
+ } )
1775
+ . await ?;
1776
+
1777
+ conn. vacuum ( ) . await
1776
1778
}
1777
1779
1778
1780
async fn save_send_queue_request (
0 commit comments