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(
|
.filter(
|
||||||
Origin.id == self.id,
|
Origin.id == self.id,
|
||||||
Deprecation.resource_type == 'Proxy',
|
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)
|
.distinct(Proxy.id)
|
||||||
.all()
|
.all()
|
||||||
|
@ -130,7 +131,8 @@ class Country(AbstractConfiguration):
|
||||||
.filter(
|
.filter(
|
||||||
Country.id == self.id,
|
Country.id == self.id,
|
||||||
Deprecation.resource_type == 'Proxy',
|
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)
|
.distinct(Proxy.id)
|
||||||
.all()
|
.all()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue