Merge branch 'maintenance' into devel
This commit is contained in:
commit
403b4ed51b
5 files changed
+18
-14
No files matched your search
+2
-2
@@ -26,8 +26,8 @@ improve/.* 1.10.0 cd955e9a46782119b36cc22b8dea5652ebbf9774 pep440-dev
|
||||
|
||||
# staging/bugfix is the branch for preparation of the 1.9.x bugfix releases
|
||||
# so are any bug/... branches
|
||||
staging/bugfix 1.9.2 1d519a21702ea180c026929da2a6e17079470b9a pep440-dev
|
||||
bug/.* 1.9.2 1d519a21702ea180c026929da2a6e17079470b9a pep440-dev
|
||||
staging/bugfix 1.9.3 f027aaa7300f70b046525a49245b33c43dd198c1 pep440-dev
|
||||
bug/.* 1.9.3 f027aaa7300f70b046525a49245b33c43dd198c1 pep440-dev
|
||||
|
||||
# staging/maintenance is currently the branch for preparation of 1.9.0rc7
|
||||
# so is regressionfix/...
|
||||
|
||||
@@ -871,10 +871,6 @@ Use the following settings to configure the server:
|
||||
# reset the setting to false
|
||||
startOnceInSafeMode: false
|
||||
|
||||
# Signals to OctoPrint that the last startup was incomplete. OctoPrint will then startup
|
||||
# in safe mode
|
||||
incompleteStartup: false
|
||||
|
||||
# Set this to true to make OctoPrint ignore incomplete startups. Helpful for development.
|
||||
ignoreIncompleteStartup: false
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ def init_platform(
|
||||
)
|
||||
settings_incomplete_startup_safemode = (
|
||||
"incomplete_startup"
|
||||
if settings.getBoolean(["server", "incompleteStartup"])
|
||||
if os.path.exists(os.path.join(settings._basedir, ".incomplete_startup"))
|
||||
and not settings.getBoolean(["server", "ignoreIncompleteStartup"])
|
||||
else None
|
||||
)
|
||||
|
||||
@@ -165,9 +165,6 @@ class ServerConfig(BaseModel):
|
||||
ignoreIncompleteStartup: bool = False
|
||||
"""Set this to true to make OctoPrint ignore incomplete startups. Helpful for development."""
|
||||
|
||||
incompleteStartup: bool = False
|
||||
"""Signals to OctoPrint that the last startup was incomplete. OctoPrint will then startup in safe mode."""
|
||||
|
||||
seenWizards: Dict[str, str] = {}
|
||||
|
||||
secretKey: Optional[str] = None
|
||||
|
||||
@@ -9,6 +9,7 @@ import logging
|
||||
import logging.config
|
||||
import mimetypes
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
import signal
|
||||
import sys
|
||||
@@ -302,9 +303,14 @@ class Server:
|
||||
if self._settings is None:
|
||||
self._settings = settings()
|
||||
|
||||
incomplete_startup_flag = (
|
||||
pathlib.Path(self._settings._basedir) / ".incomplete_startup"
|
||||
)
|
||||
if not self._settings.getBoolean(["server", "ignoreIncompleteStartup"]):
|
||||
self._settings.setBoolean(["server", "incompleteStartup"], True)
|
||||
self._settings.save()
|
||||
try:
|
||||
incomplete_startup_flag.touch()
|
||||
except Exception:
|
||||
self._logger.exception("Could not create startup triggered safemode flag")
|
||||
|
||||
if self._plugin_manager is None:
|
||||
self._plugin_manager = octoprint.plugin.plugin_manager()
|
||||
@@ -1298,8 +1304,13 @@ class Server:
|
||||
|
||||
# if there was a rogue plugin we wouldn't even have made it here, so remove startup triggered safe mode
|
||||
# flag again...
|
||||
self._settings.setBoolean(["server", "incompleteStartup"], False)
|
||||
self._settings.save()
|
||||
try:
|
||||
if incomplete_startup_flag.exists():
|
||||
incomplete_startup_flag.unlink()
|
||||
except Exception:
|
||||
self._logger.exception(
|
||||
"Could not clear startup triggered safe mode flag"
|
||||
)
|
||||
|
||||
# make a backup of the current config
|
||||
self._settings.backup(ext="backup")
|
||||
|
||||
Reference in new issue
Block a user