mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-21 05:58:20 -04:00
adding healthchecks
This commit is contained in:
parent
6a1ecc0b7d
commit
bb22147dd0
4 changed files with 47 additions and 9 deletions
|
@ -7,7 +7,7 @@ db = SqliteDatabase(f"{config.DATA_DIR}/sqlite.db")
|
|||
|
||||
class Node(Model):
|
||||
id = AutoField()
|
||||
url = CharField()
|
||||
url = CharField(unique=True)
|
||||
is_tor = BooleanField(default=False)
|
||||
available = BooleanField(default=False)
|
||||
validated = BooleanField(default=False)
|
||||
|
@ -22,4 +22,13 @@ class Node(Model):
|
|||
class Meta:
|
||||
database = db
|
||||
|
||||
db.create_tables([Node])
|
||||
class HealthCheck(Model):
|
||||
id = AutoField()
|
||||
node = ForeignKeyField(Node, backref='healthchecks')
|
||||
datetime = DateTimeField(default=datetime.utcnow)
|
||||
health = BooleanField()
|
||||
|
||||
class Meta:
|
||||
database = db
|
||||
|
||||
db.create_tables([Node, HealthCheck])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue