store = new StoreDay(device_id, date);
ret_val = store->get_mean(period_type_param);
- save(fname, ret_val, 4);
+ if ((period_type_param != PERIOD_MINUTELY) ||
+ (period_type_param != PERIOD_SECONDLY)) {
+ // no need cache second or minute data
+ save(fname, ret_val, 4);
+ }
delete(store);
}
break;
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_sum(period_type_param);
- save(fname, ret_val, 4);
+ if ((period_type_param != PERIOD_MINUTELY) ||
+ (period_type_param != PERIOD_SECONDLY)) {
+ // no need cache second or minute data
+ save(fname, ret_val, 4);
+ }
delete(store);
break;
}
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_delta(period_type_param);
- save(fname, ret_val, 4);
+ if ((period_type_param != PERIOD_MINUTELY) ||
+ (period_type_param != PERIOD_SECONDLY)) {
+ // no need cache second or minute data
+ save(fname, ret_val, 4);
+ }
delete(store);
break;
}
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_max(period_type_param);
- save(fname, ret_val, 4);
+ if ((period_type_param != PERIOD_MINUTELY) ||
+ (period_type_param != PERIOD_SECONDLY)) {
+ // no need cache second or minute data
+ save(fname, ret_val, 4);
+ }
delete(store);
break;
}
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_min(period_type_param);
- save(fname, ret_val, 4);
+ if ((period_type_param != PERIOD_MINUTELY) ||
+ (period_type_param != PERIOD_SECONDLY)) {
+ // no need cache second or minute data
+ save(fname, ret_val, 4);
+ }
delete(store);
break;
}