--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py Fri Mar 31 17:28:12 2017 +0200 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py Fri Mar 31 17:29:55 2017 +0200 @@ -9,6 +9,7 @@ import sys import multiprocessing +import queue import pycodestyle from NamingStyleChecker import NamingStyleChecker @@ -18,7 +19,6 @@ from DocStyleChecker import DocStyleChecker from MiscellaneousChecker import MiscellaneousChecker -# TODO: rename the following module from ComplexityChecker import ComplexityChecker @@ -154,11 +154,25 @@ # Get and send results endIndex = len(argumentsList) - initialTasks for i in range(len(argumentsList)): - filename, result = doneQueue.get() - send(fx, filename, result) - if cancelled(): + resultSent = False + wasCancelled = False + + while not resultSent: + try: + # get result (waiting max. 3 seconds and send it to frontend + filename, result = doneQueue.get(timeout=3) + send(fx, filename, result) + resultSent = True + except queue.Empty: + # ignore empty queue, just carry on + if cancelled(): + wasCancelled = True + break + + if wasCancelled or cancelled(): # just exit the loop ignoring the results of queued tasks break + if i < endIndex: taskQueue.put(argumentsList[i + initialTasks])