Skip to content

Commit

Permalink
Maybe queue is blocking?
Browse files Browse the repository at this point in the history
  • Loading branch information
rchiechi committed Apr 6, 2022
1 parent da09d15 commit 3c3b27e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions gaussfit/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
# from multiprocessing import Queue
from collections import Counter

import queue

# TODO Isn't this done with QueueHandler?
class DelayedHandler(logging.Handler):
Expand Down Expand Up @@ -92,4 +92,7 @@ def __init__(self, que):
self.que = que

def _emit(self, message, level):
self.que.put(message)
try:
self.que.put(message, timeout=5)
except queue.Empty:
print("Queue was empty when trying to log %s" % str(message))
2 changes: 1 addition & 1 deletion gui/libparse/GUIParse.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from gaussfit import Parse
from gui.libparse import ParseThread
from gaussfit.output.libwriter import doOutput
from queue import Queue
from multiprocessing import Queue
from gaussfit.logger import DelayedMultiprocessHandler


Expand Down

0 comments on commit 3c3b27e

Please sign in to comment.