@@ -169,14 +169,15 @@ def _fetch_validation_parameters(collection, default_buffer_size=0.1, default_sa
169169
170170
171171@celery_app .task (bind = True , name = _ ('Check missing log files' ))
172- def task_check_missing_logs_for_date_range (self , collections = [], from_date = None , until_date = None , user_id = None , username = None ):
172+ def task_check_missing_logs_for_date_range (self , collections = [], from_date = None , until_date = None , days_to_go_back = None , user_id = None , username = None ):
173173 """
174174 Task to check for missing log files in the defined date range.
175175
176176 Parameters:
177177 collections (list, optional): List of collection acronyms. Defaults to [].
178178 from_date (str, optional): The start date for log discovery in YYYY-MM-DD format. Defaults to None.
179179 until_date (str, optional): The end date for log discovery in YYYY-MM-DD format. Defaults to None.
180+ days_to_go_back (int, optional): The number of days to go back from today for log discovery. Defaults to None.
180181 user_id (int, optional): The ID of the user initiating the task. Defaults to None.
181182 username (str, optional): The username of the user initiating the task. Defaults to None.
182183
@@ -186,9 +187,11 @@ def task_check_missing_logs_for_date_range(self, collections=[], from_date=None,
186187 """
187188 user = _get_user (self .request , username = username , user_id = user_id )
188189
190+ from_date_str , until_date_str = date_utils .get_date_range_str (from_date , until_date , days_to_go_back )
191+
189192 for col in collections or Collection .acron3_list ():
190193 collection = Collection .objects .get (acron3 = col )
191- for date in date_utils .get_date_objs_from_date_range (from_date , until_date ):
194+ for date in date_utils .get_date_objs_from_date_range (from_date_str , until_date_str ):
192195 logging .info (f'Checking missings logs for collection { col } and date { date } ' )
193196 _check_missing_logs_for_date (user , collection , date )
194197
@@ -214,8 +217,8 @@ def _check_missing_logs_for_date(user, collection, date):
214217
215218
216219@celery_app .task (bind = True , name = _ ('Generate log files count report' ))
217- def task_log_files_count_status_report (self , collections = [], from_date = None , until_date = None , user_id = None , username = None ):
218- from_date , until_date = date_utils .get_date_range_str (from_date , until_date )
220+ def task_log_files_count_status_report (self , collections = [], from_date = None , until_date = None , days_to_go_back = None , user_id = None , username = None ):
221+ from_date , until_date = date_utils .get_date_range_str (from_date , until_date , days_to_go_back )
219222
220223 from_date_obj = date_utils .get_date_obj (from_date )
221224 until_date_obj = date_utils .get_date_obj (until_date )
0 commit comments