@@ -251,6 +251,11 @@ impl ProcessCdnLogQueue {
251
251
let bucket = record. s3 . bucket . name ;
252
252
let path = record. s3 . object . key ;
253
253
254
+ if Self :: is_ignored_path ( & path) {
255
+ debug ! ( "Skipping ignored path: {path}" ) ;
256
+ continue ;
257
+ }
258
+
254
259
let path = match object_store:: path:: Path :: from_url_path ( & path) {
255
260
Ok ( path) => path,
256
261
Err ( err) => {
@@ -280,6 +285,10 @@ impl ProcessCdnLogQueue {
280
285
281
286
Ok ( ( ) )
282
287
}
288
+
289
+ fn is_ignored_path ( path : & str ) -> bool {
290
+ path. contains ( "/index.staging.crates.io/" ) || path. contains ( "/index.crates.io/" )
291
+ }
283
292
}
284
293
285
294
#[ cfg( test) ]
@@ -467,6 +476,29 @@ mod tests {
467
476
assert_snapshot ! ( open_jobs( & mut test_database. connect( ) ) , @"" ) ;
468
477
}
469
478
479
+ #[ test]
480
+ fn test_ignored_path ( ) {
481
+ let is_ignored = ProcessCdnLogQueue :: is_ignored_path;
482
+
483
+ let valid_paths = vec ! [
484
+ "cloudfront/static.crates.io/EJED5RT0WA7HA.2024-02-01-10.6a8be093.gz" ,
485
+ "cloudfront/static.staging.crates.io/E6OCLKYH9FE8V.2024-02-01-10.5da9e90c.gz" ,
486
+ "fastly-requests/static.crates.io/2024-02-01T09:00:00.000-4AIwSEQyIFDSzdAT1Fqt.log.zst" ,
487
+ "fastly-requests/static.staging.crates.io/2024-02-01T09:00:00.000-QPF3Ea8eICqLkzaoC_Wt.log.zst"
488
+ ] ;
489
+ for path in valid_paths {
490
+ assert ! ( !is_ignored( path) ) ;
491
+ }
492
+
493
+ let ignored_paths = vec ! [
494
+ "cloudfront/index.crates.io/EUGCXGQIH3GQ3.2024-02-01-10.2e068fc2.gz" ,
495
+ "cloudfront/index.staging.crates.io/E35K556QRQDZXW.2024-02-01-10.900ddeaf.gz" ,
496
+ ] ;
497
+ for path in ignored_paths {
498
+ assert ! ( is_ignored( path) ) ;
499
+ }
500
+ }
501
+
470
502
fn record_deleted_handles ( queue : & mut MockSqsQueue ) -> Arc < Mutex < Vec < String > > > {
471
503
let deleted_handles = Arc :: new ( Mutex :: new ( vec ! [ ] ) ) ;
472
504
0 commit comments