added back missing function

This commit is contained in:
Robin Müller 2023-07-10 14:20:02 +02:00
parent 110cb903a6
commit 9c8b1c697b
Signed by: muellerr
GPG Key ID: 407F9B00F858F270
2 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,10 @@ void PeriodicHousekeepingHelper::initialize(float collectionInterval,
changeCollectionInterval(collectionInterval); changeCollectionInterval(collectionInterval);
} }
float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() const {
return collectionInterval;
}
bool PeriodicHousekeepingHelper::checkOpNecessary() { bool PeriodicHousekeepingHelper::checkOpNecessary() {
if (hkGenerationCd.hasTimedOut()) { if (hkGenerationCd.hasTimedOut()) {
hkGenerationCd.resetTimer(); hkGenerationCd.resetTimer();
@ -26,6 +30,8 @@ void PeriodicHousekeepingHelper::changeCollectionInterval(float newIntervalSecon
uint32_t intervalMs = newIntervalSeconds * 1000; uint32_t intervalMs = newIntervalSeconds * 1000;
if (newIntervalSeconds <= 0) { if (newIntervalSeconds <= 0) {
intervalMs = minimumPeriodicInterval; intervalMs = minimumPeriodicInterval;
newIntervalSeconds = static_cast<float>(minimumPeriodicInterval) / 1000.0;
} }
collectionInterval = newIntervalSeconds;
hkGenerationCd.setTimeout(intervalMs); hkGenerationCd.setTimeout(intervalMs);
} }

View File

@ -22,6 +22,7 @@ class PeriodicHousekeepingHelper {
private: private:
LocalPoolDataSetBase* owner = nullptr; LocalPoolDataSetBase* owner = nullptr;
Countdown hkGenerationCd; Countdown hkGenerationCd;
float collectionInterval = 0.0;
dur_millis_t minimumPeriodicInterval = 0; dur_millis_t minimumPeriodicInterval = 0;
}; };