@@ -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 ,
@@ -1247,6 +1257,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1247
1257
. await
1248
1258
}
1249
1259
1260
+ #[ instrument( skip( self , event) ) ]
1250
1261
async fn save_event ( & self , room_id : & RoomId , event : Event ) -> Result < ( ) , Self :: Error > {
1251
1262
let Some ( event_id) = event. event_id ( ) else {
1252
1263
error ! ( %room_id, "Trying to save an event with no ID" ) ;
@@ -1269,6 +1280,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1269
1280
. await
1270
1281
}
1271
1282
1283
+ #[ instrument( skip_all) ]
1272
1284
async fn add_media_content (
1273
1285
& self ,
1274
1286
request : & MediaRequestParameters ,
@@ -1278,6 +1290,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1278
1290
self . media_service . add_media_content ( self , request, content, ignore_policy) . await
1279
1291
}
1280
1292
1293
+ #[ instrument( skip_all) ]
1281
1294
async fn replace_media_key (
1282
1295
& self ,
1283
1296
from : & MediaRequestParameters ,
@@ -1299,10 +1312,12 @@ impl EventCacheStore for SqliteEventCacheStore {
1299
1312
Ok ( ( ) )
1300
1313
}
1301
1314
1315
+ #[ instrument( skip_all) ]
1302
1316
async fn get_media_content ( & self , request : & MediaRequestParameters ) -> Result < Option < Vec < u8 > > > {
1303
1317
self . media_service . get_media_content ( self , request) . await
1304
1318
}
1305
1319
1320
+ #[ instrument( skip_all) ]
1306
1321
async fn remove_media_content ( & self , request : & MediaRequestParameters ) -> Result < ( ) > {
1307
1322
let uri = self . encode_key ( keys:: MEDIA , request. source . unique_key ( ) ) ;
1308
1323
let format = self . encode_key ( keys:: MEDIA , request. format . unique_key ( ) ) ;
@@ -1313,13 +1328,15 @@ impl EventCacheStore for SqliteEventCacheStore {
1313
1328
Ok ( ( ) )
1314
1329
}
1315
1330
1331
+ #[ instrument( skip( self ) ) ]
1316
1332
async fn get_media_content_for_uri (
1317
1333
& self ,
1318
1334
uri : & MxcUri ,
1319
1335
) -> Result < Option < Vec < u8 > > , Self :: Error > {
1320
1336
self . media_service . get_media_content_for_uri ( self , uri) . await
1321
1337
}
1322
1338
1339
+ #[ instrument( skip( self ) ) ]
1323
1340
async fn remove_media_content_for_uri ( & self , uri : & MxcUri ) -> Result < ( ) > {
1324
1341
let uri = self . encode_key ( keys:: MEDIA , uri) ;
1325
1342
@@ -1329,17 +1346,20 @@ impl EventCacheStore for SqliteEventCacheStore {
1329
1346
Ok ( ( ) )
1330
1347
}
1331
1348
1349
+ #[ instrument( skip_all) ]
1332
1350
async fn set_media_retention_policy (
1333
1351
& self ,
1334
1352
policy : MediaRetentionPolicy ,
1335
1353
) -> Result < ( ) , Self :: Error > {
1336
1354
self . media_service . set_media_retention_policy ( self , policy) . await
1337
1355
}
1338
1356
1357
+ #[ instrument( skip_all) ]
1339
1358
fn media_retention_policy ( & self ) -> MediaRetentionPolicy {
1340
1359
self . media_service . media_retention_policy ( )
1341
1360
}
1342
1361
1362
+ #[ instrument( skip_all) ]
1343
1363
async fn set_ignore_media_retention_policy (
1344
1364
& self ,
1345
1365
request : & MediaRequestParameters ,
@@ -1348,6 +1368,7 @@ impl EventCacheStore for SqliteEventCacheStore {
1348
1368
self . media_service . set_ignore_media_retention_policy ( self , request, ignore_policy) . await
1349
1369
}
1350
1370
1371
+ #[ instrument( skip_all) ]
1351
1372
async fn clean_up_media_cache ( & self ) -> Result < ( ) , Self :: Error > {
1352
1373
self . media_service . clean_up_media_cache ( self ) . await
1353
1374
}
0 commit comments