@@ -453,6 +453,7 @@ async fn run_migrations(conn: &SqliteAsyncConn, version: u8) -> Result<()> {
453
453
impl EventCacheStore for SqliteEventCacheStore {
454
454
type Error = Error ;
455
455
456
+ #[ instrument( skip( self ) ) ]
456
457
async fn try_take_leased_lock (
457
458
& self ,
458
459
lease_duration_ms : u32 ,
@@ -486,6 +487,7 @@ impl EventCacheStore for SqliteEventCacheStore {
486
487
Ok ( num_touched == 1 )
487
488
}
488
489
490
+ #[ instrument( skip( self , updates) ) ]
489
491
async fn handle_linked_chunk_updates (
490
492
& self ,
491
493
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -814,6 +816,7 @@ impl EventCacheStore for SqliteEventCacheStore {
814
816
Ok ( ( ) )
815
817
}
816
818
819
+ #[ instrument( skip( self ) ) ]
817
820
async fn load_all_chunks (
818
821
& self ,
819
822
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -855,6 +858,7 @@ impl EventCacheStore for SqliteEventCacheStore {
855
858
Ok ( result)
856
859
}
857
860
861
+ #[ instrument( skip( self ) ) ]
858
862
async fn load_all_chunks_metadata (
859
863
& self ,
860
864
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -915,6 +919,7 @@ impl EventCacheStore for SqliteEventCacheStore {
915
919
. await
916
920
}
917
921
922
+ #[ instrument( skip( self ) ) ]
918
923
async fn load_last_chunk (
919
924
& self ,
920
925
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -1007,6 +1012,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1007
1012
. await
1008
1013
}
1009
1014
1015
+ #[ instrument( skip( self ) ) ]
1010
1016
async fn load_previous_chunk (
1011
1017
& self ,
1012
1018
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -1058,6 +1064,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1058
1064
. await
1059
1065
}
1060
1066
1067
+ #[ instrument( skip( self ) ) ]
1061
1068
async fn clear_all_linked_chunks ( & self ) -> Result < ( ) , Self :: Error > {
1062
1069
self . write ( )
1063
1070
. await ?
@@ -1071,6 +1078,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1071
1078
Ok ( ( ) )
1072
1079
}
1073
1080
1081
+ #[ instrument( skip( self , events) ) ]
1074
1082
async fn filter_duplicated_events (
1075
1083
& self ,
1076
1084
linked_chunk_id : LinkedChunkId < ' _ > ,
@@ -1150,6 +1158,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1150
1158
. await
1151
1159
}
1152
1160
1161
+ #[ instrument( skip( self , event_id) ) ]
1153
1162
async fn find_event (
1154
1163
& self ,
1155
1164
room_id : & RoomId ,
@@ -1179,6 +1188,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1179
1188
. await
1180
1189
}
1181
1190
1191
+ #[ instrument( skip( self , event_id, filters) ) ]
1182
1192
async fn find_event_relations (
1183
1193
& self ,
1184
1194
room_id : & RoomId ,
@@ -1209,6 +1219,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1209
1219
. await
1210
1220
}
1211
1221
1222
+ #[ instrument( skip( self , event) ) ]
1212
1223
async fn save_event ( & self , room_id : & RoomId , event : Event ) -> Result < ( ) , Self :: Error > {
1213
1224
let Some ( event_id) = event. event_id ( ) else {
1214
1225
error ! ( %room_id, "Trying to save an event with no ID" ) ;
@@ -1231,6 +1242,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1231
1242
. await
1232
1243
}
1233
1244
1245
+ #[ instrument( skip_all) ]
1234
1246
async fn add_media_content (
1235
1247
& self ,
1236
1248
request : & MediaRequestParameters ,
@@ -1240,6 +1252,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1240
1252
self . media_service . add_media_content ( self , request, content, ignore_policy) . await
1241
1253
}
1242
1254
1255
+ #[ instrument( skip_all) ]
1243
1256
async fn replace_media_key (
1244
1257
& self ,
1245
1258
from : & MediaRequestParameters ,
@@ -1261,10 +1274,12 @@ impl EventCacheStore for SqliteEventCacheStore {
1261
1274
Ok ( ( ) )
1262
1275
}
1263
1276
1277
+ #[ instrument( skip_all) ]
1264
1278
async fn get_media_content ( & self , request : & MediaRequestParameters ) -> Result < Option < Vec < u8 > > > {
1265
1279
self . media_service . get_media_content ( self , request) . await
1266
1280
}
1267
1281
1282
+ #[ instrument( skip_all) ]
1268
1283
async fn remove_media_content ( & self , request : & MediaRequestParameters ) -> Result < ( ) > {
1269
1284
let uri = self . encode_key ( keys:: MEDIA , request. source . unique_key ( ) ) ;
1270
1285
let format = self . encode_key ( keys:: MEDIA , request. format . unique_key ( ) ) ;
@@ -1275,13 +1290,15 @@ impl EventCacheStore for SqliteEventCacheStore {
1275
1290
Ok ( ( ) )
1276
1291
}
1277
1292
1293
+ #[ instrument( skip( self ) ) ]
1278
1294
async fn get_media_content_for_uri (
1279
1295
& self ,
1280
1296
uri : & MxcUri ,
1281
1297
) -> Result < Option < Vec < u8 > > , Self :: Error > {
1282
1298
self . media_service . get_media_content_for_uri ( self , uri) . await
1283
1299
}
1284
1300
1301
+ #[ instrument( skip( self ) ) ]
1285
1302
async fn remove_media_content_for_uri ( & self , uri : & MxcUri ) -> Result < ( ) > {
1286
1303
let uri = self . encode_key ( keys:: MEDIA , uri) ;
1287
1304
@@ -1291,17 +1308,20 @@ impl EventCacheStore for SqliteEventCacheStore {
1291
1308
Ok ( ( ) )
1292
1309
}
1293
1310
1311
+ #[ instrument( skip_all) ]
1294
1312
async fn set_media_retention_policy (
1295
1313
& self ,
1296
1314
policy : MediaRetentionPolicy ,
1297
1315
) -> Result < ( ) , Self :: Error > {
1298
1316
self . media_service . set_media_retention_policy ( self , policy) . await
1299
1317
}
1300
1318
1319
+ #[ instrument( skip_all) ]
1301
1320
fn media_retention_policy ( & self ) -> MediaRetentionPolicy {
1302
1321
self . media_service . media_retention_policy ( )
1303
1322
}
1304
1323
1324
+ #[ instrument( skip_all) ]
1305
1325
async fn set_ignore_media_retention_policy (
1306
1326
& self ,
1307
1327
request : & MediaRequestParameters ,
@@ -1310,6 +1330,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1310
1330
self . media_service . set_ignore_media_retention_policy ( self , request, ignore_policy) . await
1311
1331
}
1312
1332
1333
+ #[ instrument( skip_all) ]
1313
1334
async fn clean_up_media_cache ( & self ) -> Result < ( ) , Self :: Error > {
1314
1335
self . media_service . clean_up_media_cache ( self ) . await
1315
1336
}
0 commit comments