def _refresh_dag_dir(self):
elapsed_time_since_refresh = (timezone.utcnow() -<EOL>self.last_dag_dir_refresh_time).total_seconds()<EOL>if elapsed_time_since_refresh > self.dag_dir_list_interval:<EOL><INDENT>self.log.info("<STR_LIT>", self._dag_directory)<EOL>self._file_paths = list_py_file_paths(self._dag_directory)<EOL>self.last_dag_dir_refresh_time = timezone.utcnow()<EOL>self.log.info("<STR_LIT>", len(self._file_paths), self._dag_directory)<EOL>self.set_file_paths(self._file_paths)<EOL>try:<EOL><INDENT>self.log.debug("<STR_LIT>")<EOL>self.clear_nonexistent_import_errors()<EOL><DEDENT>except Exception:<EOL><INDENT>self.log.exception("<STR_LIT>")<EOL><DEDENT><DEDENT>
Refresh file paths from dag dir if we haven't done it for too long.