File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -116,14 +116,17 @@ def get_indexing_queryset(
116116 max_value = result ["max_pk" ] + 1
117117
118118 done = 0
119+ current_batch = 0
120+ total_batches = (max_value - min_value + chunk_size - 1 ) // chunk_size
119121 start = time .time ()
120122 if verbose :
121123 stdout .write (f"{ action } { model } : 0% ({ self ._eta (start , done , count )} )\r " )
122124
123125 for pk_offset in range (min_value , max_value , chunk_size ):
126+ current_batch += 1
124127 max_pk = min (pk_offset + self .django .queryset_pagination , max_value )
125128 batch_qs = qs .filter (pk__gte = pk_offset , pk__lt = max_pk )
126- stdout .write (f"Processing batch with pk from { pk_offset } to { max_pk - 1 } \n " )
129+ stdout .write (f"Processing batch { current_batch } / { total_batches } with pk from { pk_offset } to { max_pk - 1 } \n " )
127130 for obj in batch_qs :
128131 done += 1
129132 if done % chunk_size == 0 :
You can’t perform that action at this time.
0 commit comments