MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / close

Method close

keepercommander/discovery_common/process.py:116–133  ·  view source on GitHub ↗

Clean up resources held by this Process instance. Releases all DAG instances and connections to prevent memory leaks.

(self)

Source from the content-addressed store, hash-verified

114 self.logger.debug(f"discovery process is using configuration uid {self.configuration_uid}")
115
116 def close(self):
117 """
118 Clean up resources held by this Process instance.
119 Releases all DAG instances and connections to prevent memory leaks.
120 """
121
122 if hasattr(self, "jobs") and self.jobs:
123 self.jobs.close()
124 self.jobs = None
125 if hasattr(self, "infra") and self.infra:
126 self.infra.close()
127 self.infra = None
128 if hasattr(self, "record_link") and self.record_link:
129 self.record_link.close()
130 self.record_link = None
131 if hasattr(self, "user_service") and self.user_service:
132 self.user_service.close()
133 self.user_service = None
134
135 def __enter__(self):
136 """Context manager entry."""

Callers 2

__exit__Method · 0.95
__del__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected