mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 15:20:09 +01:00
added a try/catch statement to prevent panel from crashing #432
This commit is contained in:
parent
2297d6b85b
commit
204b995e6c
@ -403,9 +403,13 @@ class PeerShareLinks:
|
|||||||
# print(self.Links)
|
# print(self.Links)
|
||||||
def __getSharedLinks(self):
|
def __getSharedLinks(self):
|
||||||
self.Links.clear()
|
self.Links.clear()
|
||||||
allLinks = sqlSelect("SELECT * FROM PeerShareLinks WHERE ExpireDate IS NULL OR ExpireDate > datetime('now', 'localtime')").fetchall()
|
try:
|
||||||
for link in allLinks:
|
allLinks = sqlSelect("SELECT * FROM PeerShareLinks WHERE ExpireDate IS NULL OR ExpireDate > datetime('now', 'localtime')").fetchall()
|
||||||
self.Links.append(PeerShareLink(*link))
|
for link in allLinks:
|
||||||
|
self.Links.append(PeerShareLink(*link))
|
||||||
|
# temo fix for https://github.com/donaldzou/WGDashboard/issues/432
|
||||||
|
except sqlite3.DatabaseError as e:
|
||||||
|
print(f"Database error occurred: {e}")
|
||||||
|
|
||||||
def getLink(self, Configuration: str, Peer: str) -> list[PeerShareLink]:
|
def getLink(self, Configuration: str, Peer: str) -> list[PeerShareLink]:
|
||||||
self.__getSharedLinks()
|
self.__getSharedLinks()
|
||||||
|
Loading…
Reference in New Issue
Block a user