Skip to content

Commit

Permalink
fix performance issues on forking process (Linux) (#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykGala authored Jul 25, 2023
1 parent e7865d5 commit 5c992a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/neptune/internal/threading/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def run(self):
if self._state == Daemon.DaemonState.WORKING:
self.work()
with self._wait_condition:
if self._sleep_time > 0 and not self._is_interrupted():
if self._sleep_time > 0 and self._state == Daemon.DaemonState.WORKING:
self._wait_condition.wait(timeout=self._sleep_time)
finally:
with self._wait_condition:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ def stop(self):
self._thread.shutdown_ws_client()

def pause(self):
self._thread.shutdown_ws_client()
self._thread.pause()
pass

def resume(self):
self._thread.resume()
pass

def join(self, seconds: Optional[float] = None):
if not self._started or threading.get_ident() == self._thread.ident:
Expand Down

0 comments on commit 5c992a2

Please sign in to comment.