Skip to content
This repository was archived by the owner on Jun 26, 2021. It is now read-only.

Commit 34fbe10

Browse files
ORipplerrippel
authored andcommitted
change Queue and event to synchronous types
1 parent c88f36e commit 34fbe10

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

delira/logging/base_logger.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from multiprocessing import Queue, Event
2-
from queue import Full
1+
from multiprocessing.queues import Queue as MpQueue
2+
from threading import Event
3+
from queue import Queue, Full
34
from delira.logging.base_backend import BaseBackend
45
from delira.utils.dict_reductions import get_reduction, possible_reductions, \
56
reduce_dict
@@ -231,8 +232,9 @@ def close(self):
231232
232233
"""
233234
if hasattr(self, "_flush_queue"):
234-
self._flush_queue.close()
235-
self._flush_queue.join_thread()
235+
if isinstance(self._flush_queue, MpQueue):
236+
self._flush_queue.close()
237+
self._flush_queue.join_thread()
236238

237239
if hasattr(self, "abort_event"):
238240
self._abort_event.set()

0 commit comments

Comments
 (0)