mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-27 01:24:42 +00:00
use debug lock class
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3179 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
ab1ba455f6
commit
df8af83508
5 changed files with 10 additions and 13 deletions
5
linkcheck/cache/addrinfo.py
vendored
5
linkcheck/cache/addrinfo.py
vendored
|
|
@ -17,13 +17,12 @@
|
|||
"""
|
||||
Cache for DNS lookups.
|
||||
"""
|
||||
import threading
|
||||
import socket
|
||||
import sys
|
||||
import linkcheck.lock
|
||||
from linkcheck.decorators import synchronized
|
||||
|
||||
_lock = threading.Lock()
|
||||
|
||||
_lock = linkcheck.lock.get_lock("addrinfo")
|
||||
addrinfos = {}
|
||||
|
||||
@synchronized(_lock)
|
||||
|
|
|
|||
5
linkcheck/cache/connection.py
vendored
5
linkcheck/cache/connection.py
vendored
|
|
@ -19,11 +19,10 @@ Store and retrieve open connections.
|
|||
"""
|
||||
|
||||
import time
|
||||
import threading
|
||||
import linkcheck.lock
|
||||
from linkcheck.decorators import synchronized
|
||||
|
||||
# lock for robots.txt caching
|
||||
_lock = threading.Lock()
|
||||
_lock = linkcheck.lock.get_lock("connection")
|
||||
|
||||
|
||||
class ConnectionPool (object):
|
||||
|
|
|
|||
5
linkcheck/cache/cookie.py
vendored
5
linkcheck/cache/cookie.py
vendored
|
|
@ -17,15 +17,14 @@
|
|||
"""
|
||||
Store and retrieve cookies.
|
||||
"""
|
||||
import threading
|
||||
from linkcheck.decorators import synchronized
|
||||
import linkcheck
|
||||
import linkcheck.log
|
||||
import linkcheck.lock
|
||||
import linkcheck.cookies
|
||||
|
||||
# lock for caching
|
||||
_lock = threading.Lock()
|
||||
|
||||
_lock = linkcheck.lock.get_lock("cookie")
|
||||
|
||||
class CookieJar (object):
|
||||
"""
|
||||
|
|
|
|||
4
linkcheck/cache/geoip.py
vendored
4
linkcheck/cache/geoip.py
vendored
|
|
@ -18,12 +18,12 @@
|
|||
Store and retrieve country names for IPs.
|
||||
"""
|
||||
import os
|
||||
import threading
|
||||
import linkcheck.lock
|
||||
from linkcheck.decorators import synchronized
|
||||
|
||||
# I don't know if the geoip library is already thread-safe, but
|
||||
# we take no risks here.
|
||||
_lock = threading.Lock()
|
||||
_lock = linkcheck.lock.get_lock("geoip")
|
||||
|
||||
# initialize GeoIP database
|
||||
geoip = None
|
||||
|
|
|
|||
4
linkcheck/cache/robots_txt.py
vendored
4
linkcheck/cache/robots_txt.py
vendored
|
|
@ -17,14 +17,14 @@
|
|||
"""
|
||||
Cache robots.txt contents.
|
||||
"""
|
||||
import threading
|
||||
from linkcheck.decorators import synchronized
|
||||
import linkcheck.robotparser2
|
||||
import linkcheck.configuration
|
||||
import linkcheck.lock
|
||||
|
||||
|
||||
# lock for caching
|
||||
_lock = threading.Lock()
|
||||
_lock = linkcheck.lock.get_lock("robots.txt")
|
||||
|
||||
|
||||
class RobotsTxt (object):
|
||||
|
|
|
|||
Loading…
Reference in a new issue