Fix: Use atomic writes for all save processes
That includes uploaded files, profiles, caching files, settings and user directories.
This commit is contained in:
1 parent
abf073340f
commit
f83d5aa89f
5 files changed
+11
-5
No files matched your search
@@ -536,7 +536,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
|
||||
try:
|
||||
import json
|
||||
with open(self._repository_cache_path, "w+b") as f:
|
||||
with octoprint.util.atomic_write(self._repository_cache_path, "wb") as f:
|
||||
json.dump(repo_data, f)
|
||||
except Exception as e:
|
||||
self._logger.exception("Error while saving repository data to {}: {}".format(self._repository_cache_path, str(e)))
|
||||
|
||||
Reference in new issue
Block a user