size would be almost identical to original data file size.
Signed-off-by: Mika Laitio <lamikr@pilppa.org>
store = new StoreDay(device_id, date);
ret_val = store->get_mean(period_type_param);
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);
+ }
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_sum(period_type_param);
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);
+ }
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_delta(period_type_param);
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);
+ }
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_max(period_type_param);
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);
+ }
case PERIOD_SECONDLY:
store = new StoreDay(device_id, date);
ret_val = store->get_min(period_type_param);
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);
+ }