mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-22 04:09:32 -04:00
performance improvements on get_peers script
This commit is contained in:
parent
4dc78b3be8
commit
5bc00debc3
4 changed files with 74 additions and 74 deletions
|
@ -61,6 +61,14 @@ class Peer(Model):
|
|||
lon = FloatField(null=True)
|
||||
datetime = DateTimeField(default=datetime.utcnow)
|
||||
|
||||
@property
|
||||
def port(self):
|
||||
return urlparse(self.url).port
|
||||
|
||||
@property
|
||||
def hostname(self):
|
||||
return urlparse(self.url).hostname
|
||||
|
||||
def hours_elapsed(self):
|
||||
now = datetime.utcnow()
|
||||
diff = now - self.datetime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue