mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-29 22:01:14 -07:00
Clean up invalid quality changes robust to asynchronous changes
It's possible that a profile is no longer in the registry by the time it gets to that point in the list if this clean-up is triggered by the very action of deleting a profile. Fixes Sentry issue CURA-1T5.
This commit is contained in:
parent
f4b417883e
commit
58369822fc
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
@ -381,9 +381,10 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
if profile_count > 1:
|
if profile_count > 1:
|
||||||
continue
|
continue
|
||||||
# Only one profile found, this should not ever be the case, so that profile needs to be removed!
|
# Only one profile found, this should not ever be the case, so that profile needs to be removed!
|
||||||
Logger.log("d", "Found an invalid quality_changes profile with the name %s. Going to remove that now", profile_name)
|
|
||||||
invalid_quality_changes = ContainerRegistry.getInstance().findContainersMetadata(name=profile_name)
|
invalid_quality_changes = ContainerRegistry.getInstance().findContainersMetadata(name=profile_name)
|
||||||
self.removeContainer(invalid_quality_changes[0]["id"])
|
if invalid_quality_changes:
|
||||||
|
Logger.log("d", "Found an invalid quality_changes profile with the name %s. Going to remove that now", profile_name)
|
||||||
|
self.removeContainer(invalid_quality_changes[0]["id"])
|
||||||
|
|
||||||
@override(ContainerRegistry)
|
@override(ContainerRegistry)
|
||||||
def _isMetadataValid(self, metadata: Optional[Dict[str, Any]]) -> bool:
|
def _isMetadataValid(self, metadata: Optional[Dict[str, Any]]) -> bool:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue