From f180592cc4d544610f4f947f8706d87d87656145 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 27 Mar 2014 17:43:14 +0100 Subject: [PATCH] Increase thread poll intervall to reduce CPU usage. --- linkcheck/director/checker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linkcheck/director/checker.py b/linkcheck/director/checker.py index 80b73490..359ccfa9 100644 --- a/linkcheck/director/checker.py +++ b/linkcheck/director/checker.py @@ -23,6 +23,9 @@ from . import task from ..cache import urlqueue from .. import parser +# Interval in which each check thread looks if it's stopped. +QUEUE_POLL_INTERVALL_SECS = 1.0 + def check_urls (urlqueue, logger): """Check URLs without threading.""" @@ -94,7 +97,7 @@ class Checker(task.LoggedCheckedTask): def check_url (self): """Try to get URL data from queue and check it.""" try: - url_data = self.urlqueue.get(timeout=0.2) + url_data = self.urlqueue.get(timeout=QUEUE_POLL_INTERVALL_SECS) if url_data is not None: try: self.check_url_data(url_data)