mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix overflow before widening issues reported by Coverity
This commit is contained in:
parent
885e08d476
commit
676b2d1569
@ -107,7 +107,7 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
|
|||||||
s_logger.debug("Run missing VM report. current time: " + currentTime.getTime());
|
s_logger.debug("Run missing VM report. current time: " + currentTime.getTime());
|
||||||
|
|
||||||
// 2 times of sync-update interval for graceful period
|
// 2 times of sync-update interval for graceful period
|
||||||
long milliSecondsGracefullPeriod = PingInterval.value() * 2000;
|
long milliSecondsGracefullPeriod = PingInterval.value() * 2000L;
|
||||||
|
|
||||||
for (VMInstanceVO instance : vmsThatAreMissingReport) {
|
for (VMInstanceVO instance : vmsThatAreMissingReport) {
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,8 @@ import org.apache.cloudstack.usage.UsageTypes;
|
|||||||
|
|
||||||
import com.cloud.alert.AlertManager;
|
import com.cloud.alert.AlertManager;
|
||||||
import com.cloud.event.EventTypes;
|
import com.cloud.event.EventTypes;
|
||||||
import com.cloud.event.UsageEventVO;
|
|
||||||
import com.cloud.event.UsageEventDetailsVO;
|
import com.cloud.event.UsageEventDetailsVO;
|
||||||
|
import com.cloud.event.UsageEventVO;
|
||||||
import com.cloud.event.dao.UsageEventDao;
|
import com.cloud.event.dao.UsageEventDao;
|
||||||
import com.cloud.event.dao.UsageEventDetailsDao;
|
import com.cloud.event.dao.UsageEventDetailsDao;
|
||||||
import com.cloud.usage.dao.UsageDao;
|
import com.cloud.usage.dao.UsageDao;
|
||||||
@ -400,7 +400,6 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
long timeStart = System.currentTimeMillis();
|
long timeStart = System.currentTimeMillis();
|
||||||
long deleteOldStatsTimeMillis = 0L;
|
|
||||||
try {
|
try {
|
||||||
if ((endDateMillis == 0) || (endDateMillis > timeStart)) {
|
if ((endDateMillis == 0) || (endDateMillis > timeStart)) {
|
||||||
endDateMillis = timeStart;
|
endDateMillis = timeStart;
|
||||||
@ -433,8 +432,6 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
deleteOldStatsTimeMillis = startDateMillis;
|
|
||||||
|
|
||||||
Date startDate = new Date(startDateMillis);
|
Date startDate = new Date(startDateMillis);
|
||||||
Date endDate = new Date(endDateMillis);
|
Date endDate = new Date(endDateMillis);
|
||||||
if (s_logger.isInfoEnabled()) {
|
if (s_logger.isInfoEnabled()) {
|
||||||
@ -1766,7 +1763,7 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
long timeToJob = _jobExecTime.getTimeInMillis() - now;
|
long timeToJob = _jobExecTime.getTimeInMillis() - now;
|
||||||
long timeSinceJob = 0;
|
long timeSinceJob = 0;
|
||||||
long aggregationDurationMillis = _aggregationDuration * 60 * 1000;
|
long aggregationDurationMillis = _aggregationDuration * 60L * 1000L;
|
||||||
long lastSuccess = _usageJobDao.getLastJobSuccessDateMillis();
|
long lastSuccess = _usageJobDao.getLastJobSuccessDateMillis();
|
||||||
if (lastSuccess > 0) {
|
if (lastSuccess > 0) {
|
||||||
timeSinceJob = now - lastSuccess;
|
timeSinceJob = now - lastSuccess;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user