Fixed bug where local data was only cleared for the first sensor

This commit is contained in:
Ziver Koc 2016-10-04 22:08:44 +02:00
parent bf303604bd
commit 23f0645581
2 changed files with 1 additions and 1 deletions

Binary file not shown.

View file

@ -137,7 +137,7 @@ public class HalContext {
}
if(clearInternalAggrData){
logger.fine("Clearing local aggregate data");
db.exec("DELETE FROM sensor_data_aggr WHERE sensor_id = "
db.exec("DELETE FROM sensor_data_aggr WHERE sensor_id IN "
+ "(SELECT sensor.id FROM user, sensor WHERE user.external == 0 AND sensor.user_id = user.id)");
//update all internal sensors aggregation version to indicate for peers that they need to re-sync all data
db.exec("UPDATE sensor SET aggr_version = (aggr_version+1) WHERE id = "