I also think post and update are different things, if you look at a power to kWh process, it uses “update” not “post” as it is designed to keep overwriting the last value.
It’s something that is used on emoncms.org to manage the abandoned feeds. Originally the emoncms master branch was used for emoncms.org too and the low-write was a separate branch, we managed to combine the low-write and “normal” versions into one branch with different “modes” to reduce the versions and unify the “modes” of using emoncms. BUT the emoncmsorg repo popped up with another version of the code so that was a wasted effort.
I no longer know why the max-padding is still in the main repo since emoncms.org has it’s own repo, but IMO even if it was to stay, I think it should be a setting not hardcoded. The default setting could be max_padding = 0 and the code could be
if ($max_padding) {
if ($padding>floor($maxpadding / $meta->interval)) {
$this->log->warn("post() padding max block size exeeded id=$id, $padding dp");
return false;
}
}
This would mean a max padding of 0 would switch off max padding and the $max_padding setting would be seconds not datapoints so that all feeds would hit the limit after the same period of inactivity, eg a max_padding of 7776000 would give a limit of 90 days regardless of the interval used.
However, this feature might become redundant even on emoncms.org, you cannot really charge “per feed” and then block the user from posting to that feed, no matter how long it’s been since they last used it.
For the record, I think the max datapoint limit also needs to be user defined instead of being hardcoded. The number “8928” is hardcoded 8 times in emoncms just for the one limit. What does “8928” relate to? 1day 43mins and 12 secs for an emonTx power feed or 6days 4hours, 19mins and 12secs for an emonTH temp reading, seems a bit random.
While we’re at it, the “8928” limit, should ideally be applied after the “skip missing” is applied so that you can get “9828” valid datapoints, rather than “9828 intervals” worth of data with all the nulls removed, as that could result in very few datapoints if the data is patchy.