This method is used in DagFileProcessor.process_file - it may be easier to migrate all it's internal calls instead of the whole method.
"The store_serialized_dags parameter has been deprecated. "
                "You should pass the read_dags_from_db parameter.",
                RemovedInAirflow3Warning,
                stacklevel=2,
            )
            read_dags_from_db = store_serialized_dags
        dag_folder = dag_folder or settings.DAGS_FOLDER
        self.dag_folder = dag_folder
        self.dags: dict[str, DAG] = {}
        
        self.file_last_changed: dict[str, datetime] = {}
        self.import_errors: dict[str, str] = {}
        self.has_logged = False
        self.read_dags_from_db = read_dags_from_db
        
        self.dags_last_fetched: dict[str, datetime] = {}
        
        self.dags_hash: dict[str, str] = {}
        self.dagbag_import_error_tracebacks = conf.getboolean("core", "dagbag_import_error_tracebacks")
        self.dagbag_import_error_traceback_depth = conf.getint("core", "dagbag_import_error_traceback_depth")
        if collect_dags:
            self.collect_dags(
                dag_folder=dag_folder,
                include_examples=include_examples,
                safe_mode=safe_mode,
            )
        
        
        self.load_op_links = load_op_links
    def size(self) -> int: