| App-MadEye documentation | Contained in the App-MadEye distribution. |
App::MadEye::Rule::Interval - notification itnerval
type: map
mapping:
interval_time:
type: int
required: yes
cache_root:
type: str
required: yes
| App-MadEye documentation | Contained in the App-MadEye distribution. |
package App::MadEye::Rule::Interval; use strict; use warnings; use base qw/App::MadEye::Rule/; use Cache::FileCache; use YAML; sub dispatch { my ($self, $context, $args) = @_; my $interval_time = $self->config->{interval_time} or die "missing interval_time"; my $cache_root = $self->config->{cache_root} or die "missing cache_root"; my $key = YAML::Dump($args->{target}).__PACKAGE__; $context->log(info => "Interval: $args->{target}, $args->{plugin}"); my $cache = Cache::FileCache->new( { cache_root => $cache_root, } ); if ($cache->get($key)) { return 1; # not notify } else { $cache->set($key => "Boofy", $interval_time); return 0; } } 1; # ç£è¦ééãçãã¨ããããéç¥ãããã®ã§ããã®æéå ãªãåé¡ããã£ã¦ã # åéç¥ããªãã __END__