mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-14 09:33:09 +00:00
Increase thread poll intervall to reduce CPU usage.
This commit is contained in:
parent
83f422ec7a
commit
f180592cc4
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue