Skip to content

Commit 35cf41d

Browse files
committed
Force gc after releasing old detector
1 parent 0f19e6b commit 35cf41d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

learning_loop_node/detector/detector_node.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import contextlib
3+
import gc
34
import logging
45
import os
56
import shutil
@@ -542,6 +543,7 @@ async def _build_and_swap_detector(self, model_dir: str) -> None:
542543
if self._exclusive_model_build and isinstance(self._detector, _ActiveDetector):
543544
async with self.detection_lock: # wait for in-flight detections to finish
544545
self._detector = _Updating(version=model_info.version)
546+
gc.collect()
545547

546548
try:
547549
new_detector = await self._detector_factory.build(model_info)

0 commit comments

Comments
 (0)