Changeset 4054
- Timestamp:
- Dec 11, 2007, 11:51:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5-stable/src/core/net/sf/basedb/core/Job.java
r4034 r4054 1210 1210 private long lastUpdate; 1211 1211 1212 private int lastValue; 1213 private int offset; 1214 1212 1215 ProgressReporterImpl(Job job, String server, ProgressReporter chained) 1213 1216 throws BaseException … … 1219 1222 this.chained = chained; 1220 1223 this.lastUpdate = 0; 1224 this.lastValue = 0; 1225 this.offset = 0; 1221 1226 } 1222 1227 … … 1230 1235 if (System.currentTimeMillis() - lastUpdate > UPDATE_INTERVAL) 1231 1236 { 1237 // If the percent is negative and less then the last value, an offset will be calculated. 1238 // This will adjust the percent to a realistic value. 1239 //Notice: It is only possible to give a value close to what expected. 1240 if (percent < lastValue && percent < 0) 1241 { 1242 if (Math.abs(percent) < Math.abs(lastValue)) 1243 { 1244 offset = offset + 2*Math.abs(lastValue); 1245 } 1246 else 1247 { 1248 offset = offset + 2*Math.abs(percent); 1249 } 1250 } 1251 lastValue = percent; 1252 percent = percent + offset; 1253 1232 1254 lastUpdate = System.currentTimeMillis(); 1233 1255 DbControl dc = null;
Note: See TracChangeset
for help on using the changeset viewer.