mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Update main.py to handle readonly database connection fallback
This commit is contained in:
parent
b427887850
commit
1584d571af
1 changed files with 5 additions and 1 deletions
|
|
@ -391,6 +391,10 @@ def inject_variables():
|
|||
with LOCK:
|
||||
TMP_DATA_FILE.write_text(dumps(ui_data), encoding="utf-8")
|
||||
|
||||
if db.readonly and db.fallback_readonly:
|
||||
with suppress(BaseException):
|
||||
db.retry_connection()
|
||||
|
||||
# check that is value is in tuple
|
||||
return dict(
|
||||
script_nonce=app.config["SCRIPT_NONCE"],
|
||||
|
|
@ -402,7 +406,7 @@ def inject_variables():
|
|||
plugins=app.config["CONFIG"].get_plugins(),
|
||||
pro_loading=ui_data.get("PRO_LOADING", False),
|
||||
bw_version=metadata["version"],
|
||||
is_readonly=False,
|
||||
is_readonly=db.readonly,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue