File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -326,6 +326,13 @@ def configure(settings=None):
326326        coercer = int ,
327327        default = 100 ,
328328    )
329+     maybe_set (
330+         settings ,
331+         "metadata_backfill.batch_size" ,
332+         "METADATA_BACKFILL_BATCH_SIZE" ,
333+         coercer = int ,
334+         default = 500 ,
335+     )
329336    maybe_set_compound (settings , "billing" , "backend" , "BILLING_BACKEND" )
330337    maybe_set_compound (settings , "files" , "backend" , "FILES_BACKEND" )
331338    maybe_set_compound (settings , "archive_files" , "backend" , "ARCHIVE_FILES_BACKEND" )
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def sync_file_to_cache(request, file_id):
6464@tasks .task (ignore_result = True , acks_late = True ) 
6565def  backfill_metadata (request ):
6666    metrics  =  request .find_service (IMetricsService , context = None )
67+     batch_size  =  request .registry .settings ["backfill_metadata.batch_size" ]
6768
6869    # Get all wheel files without metadata in reverse chronologicial order 
6970    files_without_metadata  =  (
@@ -73,8 +74,7 @@ def backfill_metadata(request):
7374        .filter (File .metadata_file_unbackfillable .isnot (True ))
7475        .order_by (desc (File .upload_time ))
7576    )
76- 
77-     for  file_  in  files_without_metadata .yield_per (100 ).limit (500 ):
77+     for  file_  in  files_without_metadata .yield_per (100 ).limit (batch_size ):
7878        request .task (backfill_metadata_individual ).delay (file_ .id )
7979
8080    metrics .increment ("warehouse.packaging.metadata_backfill.tasks" )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments