Thu, 22 Jun 2017 18:24:40 +0200
Added functionality to limit the number of processes used for background services.
--- a/ChangeLog Sun Apr 09 17:17:53 2017 +0200 +++ b/ChangeLog Thu Jun 22 18:24:40 2017 +0200 @@ -1,5 +1,9 @@ ChangeLog --------- +Version 1.1.0: +- added functionality to limit the number of processes used for background + services + Version 1.0.5: - bug fixes
--- a/PluginVulture.py Sun Apr 09 17:17:53 2017 +0200 +++ b/PluginVulture.py Thu Jun 22 18:24:40 2017 +0200 @@ -24,7 +24,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "1.0.5" +version = "1.1.0" className = "VulturePlugin" packageName = "VultureChecker" shortDescription = "Plug-in to detect unused code using the vulture library"
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html Sun Apr 09 17:17:53 2017 +0200 +++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html Thu Jun 22 18:24:40 2017 +0200 @@ -152,7 +152,7 @@ <hr /><hr /> <a NAME="batchVultureCheck" ID="batchVultureCheck"></a> <h2>batchVultureCheck</h2> -<b>batchVultureCheck</b>(<i>argumentsList, send, fx, cancelled</i>) +<b>batchVultureCheck</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>) <p> Module function to analyze a batch of files. </p><dl> @@ -168,6 +168,9 @@ </dd><dt><i>cancelled</i> (function)</dt> <dd> reference to function checking for a cancellation +</dd><dt><i>maxProcesses</i> (int)</dt> +<dd> +number of processes to be used </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/VultureChecker/VultureCheckerService.py Sun Apr 09 17:17:53 2017 +0200 +++ b/VultureChecker/VultureCheckerService.py Thu Jun 22 18:24:40 2017 +0200 @@ -57,7 +57,7 @@ return __analyze(file, text) -def batchVultureCheck(argumentsList, send, fx, cancelled): +def batchVultureCheck(argumentsList, send, fx, cancelled, maxProcesses=0): """ Module function to analyze a batch of files. @@ -69,13 +69,19 @@ @type str @param cancelled reference to function checking for a cancellation @type function + @param maxProcesses number of processes to be used + @type int """ - try: - NumberOfProcesses = multiprocessing.cpu_count() - if NumberOfProcesses >= 1: - NumberOfProcesses -= 1 - except NotImplementedError: - NumberOfProcesses = 1 + if maxProcesses == 0: + # determine based on CPU count + try: + NumberOfProcesses = multiprocessing.cpu_count() + if NumberOfProcesses >= 1: + NumberOfProcesses -= 1 + except NotImplementedError: + NumberOfProcesses = 1 + else: + NumberOfProcesses = maxProcesses # Create queues taskQueue = multiprocessing.Queue()