mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 13:15:10 +08: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,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,8 +381,9 @@ 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)
|
||||||
|
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"])
|
self.removeContainer(invalid_quality_changes[0]["id"])
|
||||||
|
|
||||||
@override(ContainerRegistry)
|
@override(ContainerRegistry)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user