Close all shards.
(self)
| 444 | del self._envs[shard_id] |
| 445 | |
| 446 | def close_all(self): |
| 447 | """Close all shards.""" |
| 448 | with self._lock: |
| 449 | for shard_id in list(self._envs.keys()): |
| 450 | try: |
| 451 | self._envs[shard_id].close() |
| 452 | except Exception: |
| 453 | pass |
| 454 | self._envs.clear() |
| 455 | |
| 456 | @classmethod |
| 457 | def close_all_instances(cls): |