File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ class CtormConfig:
2424 source_buckets : list
2525 granules_sqs_queue_url : str
2626
27+ # This is the number of granules that will be prepared for test.
28+ granule_goal : int = 2000000
29+
2730 @classmethod
2831 def from_file (
2932 cls ,
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ class CtormPrepare:
6363
6464 def __init__ (self , cfg : CtormConfig ):
6565 self .cfg = cfg
66+ self .total_granules = 0
6667
6768 def prepare (self ):
68- goal = 50
69- while goal > 0 : # TODO: replace with while true and an exit condition
69+ while self .total_granules < self .cfg .granule_goal :
7070 # This is the loop that creates a SQS message from multiple objects.
7171 sqs_msg = CtormSqsMessage (self .cfg )
7272 for b in self .cfg .source_buckets :
@@ -86,10 +86,10 @@ def prepare(self):
8686 file = self .process_ummg (ummg , b )
8787 if file :
8888 sqs_msg .add_file (file )
89- goal - = 1
89+ self . total_granules + = 1
9090 b .next_cont_token = page .get ("NextContinuationToken" )
9191
92- log .debug ("goal : %d" , goal )
92+ log .debug ("tot granules : %d/%d " , self . total_granules , self . cfg . granule_goal )
9393 log .debug ("sqs_msg size: %d" , len (sqs_msg .to_json ()))
9494 log .debug ("sqs_msg size OK?: %d" , sqs_msg .check_message_size ())
9595 if sqs_msg .check_message_size ():
You can’t perform that action at this time.
0 commit comments