Commit 64276567 authored by Alessio Netti's avatar Alessio Netti
Browse files

Collectagent: fixing timing bug for cache cleanup

parent 4dbecd1e
......@@ -856,7 +856,7 @@ int main(int argc, char* const argv[]) {
LOG(info) << "Collect Agent running...";
while(keepRunning) {
start = getTimestamp();
if(NS_TO_S(start - lastCleanup) > settings.cleaningInterval) {
if(NS_TO_S(start) - NS_TO_S(lastCleanup) > settings.cleaningInterval) {
uint64_t purged = mySensorCache.clean(S_TO_NS(settings.cleaningInterval));
lastCleanup = start;
if(purged > 0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment