mirror of https://github.com/apache/cloudstack.git
Move the snapshotDao.remove(snapshotId); (#4006)
This commit is contained in:
parent
7121967892
commit
3eafab4221
|
|
@ -267,6 +267,7 @@ public class DefaultSnapshotStrategy extends SnapshotStrategyBase {
|
|||
boolean deletedOnSecondary = false;
|
||||
if (snapshotOnImage == null) {
|
||||
s_logger.debug(String.format("Can't find snapshot [snapshot id: %d] on backup storage", snapshotId));
|
||||
snapshotDao.remove(snapshotId);
|
||||
} else {
|
||||
SnapshotObject obj = (SnapshotObject)snapshotOnImage;
|
||||
try {
|
||||
|
|
@ -326,7 +327,6 @@ public class DefaultSnapshotStrategy extends SnapshotStrategyBase {
|
|||
if (isSnapshotOnPrimaryStorage(snapshotId) && snapshotSvr.deleteSnapshot(snapshotOnPrimaryInfo)) {
|
||||
snapshotOnPrimary.setState(State.Destroyed);
|
||||
snapshotStoreDao.update(snapshotOnPrimary.getId(), snapshotOnPrimary);
|
||||
snapshotDao.remove(snapshotId);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue