mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-19 22:27:47 -04:00
Automatically remove dead nodes (#18)
* remove nodes if all the health checks are failed * use utc * node should have at least 5 health checks
This commit is contained in:
parent
b0df1f66c4
commit
c78fe4f9f1
2 changed files with 14 additions and 1 deletions
|
|
@ -23,6 +23,14 @@ class Node(Model):
|
|||
datetime_failed = DateTimeField(default=None, null=True)
|
||||
fail_reason = CharField(null=True)
|
||||
|
||||
def get_failed_checks(self):
|
||||
hcs = HealthCheck.select().where(HealthCheck.node == self, HealthCheck.health == False)
|
||||
return hcs
|
||||
|
||||
def get_all_checks(self):
|
||||
hcs = HealthCheck.select().where(HealthCheck.node == self)
|
||||
return hcs
|
||||
|
||||
class Meta:
|
||||
database = db
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue