mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-19 11:38:21 -04:00
fix 'CrawlUrl' object has no attribute 'priority' bug
This commit is contained in:
parent
4022cc0162
commit
32abfcac8a
1 changed files with 3 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ class CrawlUrl:
|
||||||
self.priority_key = (priority << 32) | (hash(self.url) & (2**32 - 1))
|
self.priority_key = (priority << 32) | (hash(self.url) & (2**32 - 1))
|
||||||
|
|
||||||
def get_priority(self):
|
def get_priority(self):
|
||||||
return self.priority >> 32
|
return self.priority_key >> 32
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def host(self):
|
def host(self):
|
||||||
|
|
@ -29,8 +29,8 @@ class CrawlUrl:
|
||||||
class Frontier:
|
class Frontier:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# {url:CrawlUrl}
|
# {url:CrawlUrl}
|
||||||
self.urls = {}
|
self.urls = {}
|
||||||
|
|
||||||
# {host:SortedDict{priority_key:CrawlUrl}}
|
# {host:SortedDict{priority_key:CrawlUrl}}
|
||||||
self.queues_by_host = {}
|
self.queues_by_host = {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue