bug fix where aggr was crashing when no user whas assigned to a sensor
Former-commit-id: f5d59c67752f24f9834e457211e4c155d3dc4b5b
This commit is contained in:
parent
3e9d255532
commit
51b549528c
1 changed files with 9 additions and 7 deletions
|
|
@ -43,13 +43,15 @@ public class SensorDataCleanupDaemon implements HalDaemon {
|
|||
public void cleanupSensor(Sensor sensor) {
|
||||
//if(sensor instanceof PowerConsumptionSensorData){
|
||||
//logger.fine("The sensor is of type: " + sensor.getDeviceData().getClass().getName()); // this will instantiate the external sensor data
|
||||
if(sensor.getUser().isExternal()){
|
||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||
}else{
|
||||
cleanupInternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
||||
cleanupInternalSensorData(sensor.getId(), TimeUtility.DAY_IN_MS, TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||
}
|
||||
if (sensor.getUser() != null) {
|
||||
if (sensor.getUser().isExternal()) {
|
||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||
} else {
|
||||
cleanupInternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
||||
cleanupInternalSensorData(sensor.getId(), TimeUtility.DAY_IN_MS, TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||
}
|
||||
}
|
||||
//}else{
|
||||
// logger.fine("The sensor type is not supported by the cleanup deamon. Ignoring");
|
||||
//}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue