fail early if LNBITS_DATA_FOLDER missing
This commit is contained in:
parent
b1c75813a0
commit
946ebc350e
1 changed files with 9 additions and 3 deletions
|
|
@ -130,9 +130,15 @@ class Database(Compat):
|
|||
)
|
||||
)
|
||||
else:
|
||||
if os.path.isdir(LNBITS_DATA_FOLDER):
|
||||
self.path = os.path.join(LNBITS_DATA_FOLDER, f"{self.name}.sqlite3")
|
||||
database_uri = f"sqlite:///{self.path}"
|
||||
self.type = SQLITE
|
||||
else:
|
||||
raise NotADirectoryError(
|
||||
f"LNBITS_DATA_FOLDER named {LNBITS_DATA_FOLDER} was not created"
|
||||
f" - please 'mkdir {LNBITS_DATA_FOLDER}' and try again"
|
||||
)
|
||||
|
||||
self.schema = self.name
|
||||
if self.name.startswith("ext_"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue