mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-21 01:54:34 +00:00
Improve periodic activities flags logic
This commit is contained in:
parent
2d672c9438
commit
3cd4532b3e
3 changed files with 15 additions and 25 deletions
|
|
@ -393,9 +393,14 @@ void ThreadedActivity::runScript(char *script_path, NetworkInterface *iface, tim
|
|||
/* Set the deadline and the threaded activity in the vm so they can be accessed */
|
||||
l->setThreadedActivityData(this, thstats, deadline);
|
||||
|
||||
if(thstats)
|
||||
if(thstats) {
|
||||
thstats->setCurrentProgress(0);
|
||||
|
||||
/* Reset the internal state for the current execution */
|
||||
thstats->setNotExecutedAttivity(false);
|
||||
thstats->setSlowPeriodicActivity(false);
|
||||
}
|
||||
|
||||
gettimeofday(&begin, NULL);
|
||||
updateThreadedActivityStatsBegin(iface, &begin);
|
||||
|
||||
|
|
@ -417,13 +422,12 @@ void ThreadedActivity::runScript(char *script_path, NetworkInterface *iface, tim
|
|||
thstats->setDeadline(time(NULL) + getPeriodicity());
|
||||
|
||||
if((max_duration_ms > 0) && (msec_diff > 2*max_duration_ms)) {
|
||||
thstats->setSlowPeriodicActivity();
|
||||
} else
|
||||
thstats->clearErrors();
|
||||
thstats->setSlowPeriodicActivity(true);
|
||||
}
|
||||
}
|
||||
} else if(deadline) {
|
||||
if(isDeadlineApproaching(deadline))
|
||||
thstats->setSlowPeriodicActivity();
|
||||
thstats->setSlowPeriodicActivity(true);
|
||||
}
|
||||
|
||||
if(l && !reuse_vm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue