HTML parser queue flush fix
- the queue wasn't correctly flushed
This commit is contained in:
parent
d35062b49c
commit
54e3465575
|
@ -120,6 +120,13 @@ class SafeHTMLParser(HTMLParser):
|
||||||
parserProcess = multiprocessing.Process(target=regexpSubprocess, name="RegExParser", args=(parserInputQueue, parserOutputQueue))
|
parserProcess = multiprocessing.Process(target=regexpSubprocess, name="RegExParser", args=(parserInputQueue, parserOutputQueue))
|
||||||
parserProcess.start()
|
parserProcess.start()
|
||||||
parserLock.release()
|
parserLock.release()
|
||||||
|
# flush queue
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
tmp = parserOutputQueue.get(False)
|
||||||
|
except Queue.Empty:
|
||||||
|
logger.debug("Parser queue flushed")
|
||||||
|
pass
|
||||||
parserInputQueue.put(tmp)
|
parserInputQueue.put(tmp)
|
||||||
try:
|
try:
|
||||||
tmp = parserOutputQueue.get(True, 1)
|
tmp = parserOutputQueue.get(True, 1)
|
||||||
|
@ -130,14 +137,6 @@ class SafeHTMLParser(HTMLParser):
|
||||||
parserProcess = multiprocessing.Process(target=regexpSubprocess, name="RegExParser", args=(parserInputQueue, parserOutputQueue))
|
parserProcess = multiprocessing.Process(target=regexpSubprocess, name="RegExParser", args=(parserInputQueue, parserOutputQueue))
|
||||||
parserProcess.start()
|
parserProcess.start()
|
||||||
parserLock.release()
|
parserLock.release()
|
||||||
else:
|
|
||||||
# flush queue
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
tmp = parserOutputQueue.get(False)
|
|
||||||
except Queue.Empty:
|
|
||||||
logger.debug("Parser queue flushed")
|
|
||||||
pass
|
|
||||||
|
|
||||||
self.raw += tmp
|
self.raw += tmp
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user