mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
feat: Update status column default value in Instances table
The default value of the `status` column in the `Instances` table has been changed from "up" to "loading". This update ensures that new instances are marked as "loading" by default until their health status is determined.
This commit is contained in:
parent
081d953bdb
commit
afabcf6e60
2 changed files with 2 additions and 1 deletions
|
|
@ -3111,6 +3111,7 @@ class Database:
|
|||
hostname=instance["hostname"],
|
||||
port=instance["env"].get("API_HTTP_PORT", 5000),
|
||||
server_name=instance["env"].get("API_SERVER_NAME", "bwapi"),
|
||||
status="up" if instance.get("health", True) else "down",
|
||||
method=method,
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class Instances(Base):
|
|||
hostname = Column(String(256), primary_key=True)
|
||||
port = Column(Integer, nullable=False)
|
||||
server_name = Column(String(256), nullable=False)
|
||||
status = Column(INSTANCE_STATUS_ENUM, nullable=True, default="up")
|
||||
status = Column(INSTANCE_STATUS_ENUM, nullable=True, default="loading")
|
||||
method = Column(METHODS_ENUM, nullable=False, default="manual")
|
||||
creation_date = Column(DateTime, nullable=False, server_default=func.now())
|
||||
last_seen = Column(DateTime, nullable=True, server_default=func.now(), onupdate=partial(datetime.now, timezone.utc))
|
||||
|
|
|
|||
Loading…
Reference in a new issue