From c56838e742a4c8966b89f85be378221b019abcd3 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 31 Aug 2014 17:57:07 -0500 Subject: [PATCH] Only spawn one worker for comparisons in local mode. --- earwigbot/wiki/copyvios/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/earwigbot/wiki/copyvios/__init__.py b/earwigbot/wiki/copyvios/__init__.py index d05037d..f4c3cb2 100644 --- a/earwigbot/wiki/copyvios/__init__.py +++ b/earwigbot/wiki/copyvios/__init__.py @@ -167,13 +167,14 @@ class CopyvioMixIn(object): start_time = time() until = (start_time + max_time) if max_time > 0 else None article = MarkovChain(ArticleTextParser(self.get()).strip()) - workspace = CopyvioWorkspace(article, min_confidence, until, - self._logger, self._addheaders, max_time) + workspace = CopyvioWorkspace( + article, min_confidence, until, self._logger, self._addheaders, + max_time, 1) workspace.enqueue([url]) workspace.wait() best = workspace.best - result = CopyvioCheckResult(best.confidence >= min_confidence, - best.confidence, best.url, 0, - time() - start_time, article, best.chains) + result = CopyvioCheckResult( + best.confidence >= min_confidence, best.confidence, best.url, 0, + time() - start_time, article, best.chains) self._logger.info(result.get_log_message(self.title)) return result