Skip to content

Commit

Permalink
Merge pull request #482 from SCADA-LTS/feature/#479_Improving_the_rem…
Browse files Browse the repository at this point in the history
…oval_of_old_values

#457 fix purge data (to test)
  • Loading branch information
grzesiekb authored Mar 1, 2018
2 parents 68c2f52 + 158ed2d commit f3e365b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ env:
- secure: KNfVmgjr2ZNsnvIfuhSkZ/kPrSTjn6WSDxEJt/3ioTCgeEGGvPL7UGonHHozZu3WzpzBVyUr60hXjb1nmb9dk6A3Dg05UPZmuS7NiHEA4Ub2zQKgefSbK0AJEhXSDg+bT16Hqxf1aZDaAEpMXGWTGLdpbKkGAW56UZu6LpOlOvoX9pFoSWAyzh1jKiYQsaKJ3eCncHKug5WqTVidOL/ENR6CAYyVLkgZ0yffwsCyVAnh14vri2lswPhPsPvMzYxtLQGkKkUOYkuPOZvBD7l5mp5Y4QLv86iKTFlOteim7yD+RpZZDFpb+3+OhRuj6jlBYWina33RKqBqjhhsayyYN/tYnPUefZhT+ALs8JfUaDXqMdgd7NQj8i5ZvrB+YsCTUVGrnPVbmEq8A4l/An5ushQpK5CrASiAC0K4dOBVT+U89QHtYWuE3ZOmSb518dlbH084ljypAj3JTQpUgRAAxn21VUMKb6QyIPsSPVEQ+zPQnaxBLhYVqafO7iX1tyvdr0mGhLZjXaaGwQu8Y/RoHdmRYcQAGn6zVFNuxWxTlr2OQ0fJ5l6/qBVyqZvqNirYa5hX8KtDu3dVMo5VOirIsoJTw75qTpGxYjhCNCb/woxtRvfX9xoT7tINWOxi2ucFfObSCsTv+BPeZeJiq7UDuFQYsQtWjNRp/iQNJ+rclpQ=
after_script:
# get tomcat7 to ./docker/app
- wget http://www-us.apache.org/dist/tomcat/tomcat-7/v7.0.84/bin/apache-tomcat-7.0.84.tar.gz
- wget http://www-us.apache.org/dist/tomcat/tomcat-7/v7.0.85/bin/apache-tomcat-7.0.85.tar.gz
- mkdir ./docker/app
- mv apache-tomcat-7.0.84.tar.gz ./docker/app
- ls -l ./docker/app/apache-tomcat-7.0.84.tar.gz
- mv apache-tomcat-7.0.85.tar.gz ./docker/app
- ls -l ./docker/app/apache-tomcat-7.0.85.tar.gz
- cd ./docker/app
- echo `pwd`
- echo `ls -l`
- tar -zxvf apache-tomcat-7.0.84.tar.gz
- tar -zxvf apache-tomcat-7.0.85.tar.gz
- ls -l
- mv ./apache-tomcat-7.0.84/* ./
- rm -rf ./apache-tomcat-7.0.84
- mv ./apache-tomcat-7.0.85/* ./
- rm -rf ./apache-tomcat-7.0.85
- cp ../../ScadaBR.war ./webapps
- cp ../../ScadaLTS-UI/war/ScadaLTS.war ./webapps
- ls -l ./webapps/ScadaLTS.war
Expand Down
21 changes: 11 additions & 10 deletions src/com/serotonin/mango/rt/RuntimeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -530,39 +530,40 @@ public void forcePointRead(int dataPointId) {
}

public long purgeDataPointValues() {
/*

PointValueDao pointValueDao = new PointValueDao();
long count = pointValueDao.deleteAllPointData();
pointValueDao.compressTables();
for (Integer id : dataPoints.keySet())
updateDataPointValuesRT(id);
return count;*/
return count;
//TODO not allow the deletion of data should be switched to a new database
return 0;
//return 0;
}

public long purgeDataPointValues(int dataPointId, int periodType,
int periodCount) {
long before = DateUtils.minus(System.currentTimeMillis(), periodType,
periodCount);
return purgeDataPointValues(dataPointId, before);
long result = purgeDataPointValues(dataPointId, before);
return result;
}

public long purgeDataPointValues(int dataPointId) {
/*long count = new PointValueDao().deletePointValues(dataPointId);
long count = new PointValueDao().deletePointValues(dataPointId);
updateDataPointValuesRT(dataPointId);
return count;*/
return count;
//TODO not allow the deletion of data should be switched to a new database
return 0;
//return 0;
}

public long purgeDataPointValues(int dataPointId, long before) {
/*long count = new PointValueDao().deletePointValuesBefore(dataPointId,
long count = new PointValueDao().deletePointValuesBefore(dataPointId,
before);
if (count > 0)
updateDataPointValuesRT(dataPointId);
return count;*/
return 0;
return count;
//return 0;
}

private void updateDataPointValuesRT(int dataPointId) {
Expand Down

0 comments on commit f3e365b

Please sign in to comment.