fix: ignore destroyed proxies in risk score calculation
This commit is contained in:
parent
b49e527bf6
commit
0aa41b303d
1 changed files with 4 additions and 2 deletions
|
@ -85,7 +85,8 @@ class Origin(AbstractConfiguration):
|
|||
.filter(
|
||||
Origin.id == self.id,
|
||||
Deprecation.resource_type == 'Proxy',
|
||||
Deprecation.deprecated_at >= datetime.utcnow() - timedelta(hours=168)
|
||||
Deprecation.deprecated_at >= datetime.utcnow() - timedelta(hours=168),
|
||||
Deprecation.reason != "destroyed"
|
||||
)
|
||||
.distinct(Proxy.id)
|
||||
.all()
|
||||
|
@ -130,7 +131,8 @@ class Country(AbstractConfiguration):
|
|||
.filter(
|
||||
Country.id == self.id,
|
||||
Deprecation.resource_type == 'Proxy',
|
||||
Deprecation.deprecated_at >= datetime.utcnow() - timedelta(hours=168)
|
||||
Deprecation.deprecated_at >= datetime.utcnow() - timedelta(hours=168),
|
||||
Deprecation.reason != "destroyed"
|
||||
)
|
||||
.distinct(Proxy.id)
|
||||
.all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue