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,6 +43,7 @@ public class SensorDataCleanupDaemon implements HalDaemon {
|
||||||
public void cleanupSensor(Sensor sensor) {
|
public void cleanupSensor(Sensor sensor) {
|
||||||
//if(sensor instanceof PowerConsumptionSensorData){
|
//if(sensor instanceof PowerConsumptionSensorData){
|
||||||
//logger.fine("The sensor is of type: " + sensor.getDeviceData().getClass().getName()); // this will instantiate the external sensor data
|
//logger.fine("The sensor is of type: " + sensor.getDeviceData().getClass().getName()); // this will instantiate the external sensor data
|
||||||
|
if (sensor.getUser() != null) {
|
||||||
if (sensor.getUser().isExternal()) {
|
if (sensor.getUser().isExternal()) {
|
||||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
cleanupExternalSensorData(sensor.getId(), TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
||||||
cleanupExternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
cleanupExternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||||
|
|
@ -50,6 +51,7 @@ public class SensorDataCleanupDaemon implements HalDaemon {
|
||||||
cleanupInternalSensorData(sensor.getId(), TimeUtility.HOUR_IN_MS, TimeUtility.FIVE_MINUTES_IN_MS, TimeUtility.DAY_IN_MS);
|
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);
|
cleanupInternalSensorData(sensor.getId(), TimeUtility.DAY_IN_MS, TimeUtility.HOUR_IN_MS, TimeUtility.WEEK_IN_MS);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//}else{
|
//}else{
|
||||||
// logger.fine("The sensor type is not supported by the cleanup deamon. Ignoring");
|
// logger.fine("The sensor type is not supported by the cleanup deamon. Ignoring");
|
||||||
//}
|
//}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue