Clean up resources held by this Process instance. Releases all DAG instances and connections to prevent memory leaks.
(self)
| 105 | self.logger.debug(f"discovery process is using configuration uid {self.configuration_uid}") |
| 106 | |
| 107 | def close(self): |
| 108 | """ |
| 109 | Clean up resources held by this Process instance. |
| 110 | Releases all DAG instances and connections to prevent memory leaks. |
| 111 | """ |
| 112 | |
| 113 | if hasattr(self, "jobs") and self.jobs: |
| 114 | self.jobs.close() |
| 115 | self.jobs = None |
| 116 | if hasattr(self, "infra") and self.infra: |
| 117 | self.infra.close() |
| 118 | self.infra = None |
| 119 | if hasattr(self, "record_link") and self.record_link: |
| 120 | self.record_link.close() |
| 121 | self.record_link = None |
| 122 | if hasattr(self, "user_service") and self.user_service: |
| 123 | self.user_service.close() |
| 124 | self.user_service = None |
| 125 | |
| 126 | def __enter__(self): |
| 127 | """Context manager entry.""" |