only decrease the snapshot count when the snapshot status is in backuped state

This commit is contained in:
Edison Su 2012-01-26 13:53:52 -08:00
parent 848bbad952
commit a455435f5f
1 changed files with 1 additions and 1 deletions

View File

@ -722,8 +722,8 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
if (snapshot.getStatus() == Snapshot.Status.BackedUp) {
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
_usageEventDao.persist(usageEvent);
_accountMgr.decrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
}
_accountMgr.decrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
txn.commit();
long lastId = snapshotId;