mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Usage: Fixup entity exists exception (#8726)
This commit is contained in:
parent
d487a1c341
commit
f8fd22c2d6
@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
import javax.persistence.EntityExistsException;
|
||||
|
||||
import org.apache.cloudstack.quota.QuotaAlertManager;
|
||||
import org.apache.cloudstack.quota.QuotaManager;
|
||||
@ -983,6 +984,7 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
||||
|
||||
private void createHelperRecord(UsageEventVO event) {
|
||||
String eventType = event.getType();
|
||||
try {
|
||||
if (isVMEvent(eventType)) {
|
||||
createVMHelperEvent(event);
|
||||
} else if (isIPEvent(eventType)) {
|
||||
@ -1012,6 +1014,9 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
||||
} else if (isBackupEvent(eventType)) {
|
||||
createBackupEvent(event);
|
||||
}
|
||||
} catch (EntityExistsException e) {
|
||||
s_logger.warn(String.format("Failed to create usage event id: %d type: %s due to %s", event.getId(), eventType, e.getMessage()), e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isVMEvent(String eventType) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user