@@ -490,7 +490,7 @@ async def process_maintainers(
490490 execution_status = ExecutionStatus .SUCCESS
491491 error_code = None
492492 error_message = None
493- latest_maintainer_file = None
493+ latest_maintainer_file = repository . maintainer_file
494494 ai_cost = 0.0
495495 maintainers_found = 0
496496 maintainers_skipped = 0
@@ -528,6 +528,18 @@ async def process_maintainers(
528528 maintainers .maintainer_info ,
529529 repository .last_maintainer_run_at ,
530530 )
531+ await update_maintainer_run (repository .id , latest_maintainer_file )
532+ except MaintainerIntervalNotElapsedError as e :
533+ execution_status = ExecutionStatus .FAILURE
534+ error_message = e .error_message
535+ error_code = e .error_code .value
536+ except MaintainerFileNotFoundError as e :
537+ await update_maintainer_run (repository .id , maintainer_file = None )
538+ execution_status = ExecutionStatus .FAILURE
539+ error_message = e .error_message
540+ error_code = e .error_code .value
541+ ai_cost = e .ai_cost
542+ self .logger .error (f"Maintainer processing failed: { error_message } " )
531543 except Exception as e :
532544 execution_status = ExecutionStatus .FAILURE
533545 error_message = e .error_message if isinstance (e , CrowdGitError ) else repr (e )
@@ -537,11 +549,8 @@ async def process_maintainers(
537549 # Capture AI cost even on error if it's a CrowdGitError with ai_cost
538550 if isinstance (e , CrowdGitError ) and hasattr (e , "ai_cost" ):
539551 ai_cost = e .ai_cost
540-
541552 self .logger .error (f"Maintainer processing failed: { error_message } " )
542553 finally :
543- await update_maintainer_run (repository .id , latest_maintainer_file )
544-
545554 end_time = time_module .time ()
546555 execution_time = Decimal (str (round (end_time - start_time , 2 )))
547556
0 commit comments