Skip to content
Snippets Groups Projects
Commit 08e7243a authored by Mark Harrison's avatar Mark Harrison
Browse files

Fix per-check interval/cached metrics

Credit: Michal Racek <michal.racek@t-systems.sk>

In Resmon 1, it was possible to add an interval parameter to an individual
check to give it a larger check interval than regular checks (cached results
would be returned in the meantime). This functionality wasn't properly carried
over into resmon 2, and this commit fixes that.
parent a170ad2d
No related branches found
No related tags found
No related merge requests found
...@@ -28,9 +28,9 @@ sub cache_metrics { ...@@ -28,9 +28,9 @@ sub cache_metrics {
sub get_cached_metrics { sub get_cached_metrics {
my $self = shift; my $self = shift;
return undef unless $self->{check_interval}; return undef unless $self->{config}->{interval};
my $now = time; my $now = time;
if(($self->{lastupdate} + $self->{check_interval}) >= $now) { if(($self->{lastupdate} + $self->{config}->{interval}) >= $now) {
return $self->{lastmetrics}; return $self->{lastmetrics};
} }
return undef; return undef;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment