Permalink
Browse files

be simple

git-svn-id: http://svn.coderepos.org/share/lang/perl/App-MadEye/trunk@14629 d0d07461-0603-4401-acd4-de1884942a52
  • Loading branch information...
1 parent 7739ea6 commit 1e53d65aceb27d613e637a4a7a4129f257ce4e75 tokuhirom committed Jun 26, 2008
@@ -5,15 +5,15 @@ use base qw/App::MadEye::Plugin::Base/;
use LWP::UserAgent;
use Fcntl ":flock";
-sub check : Hook('check') {
+sub check : Hook {
my ($self, $context, $args) = @_;
my $file_name = $self->config->{config}->{file} or die "missing file";
open $self->{lock_fh} , '>' , $file_name or die $!;
my $status = flock( $self->{lock_fh}, LOCK_EX|LOCK_NB ) or die "cannot get the lock";
}
-sub release_lock : Hook('after_run_jobs') {
+sub after_run_jobs : Hook {
my ($self, $context, $args) = @_;
close($self->{lock_fh}); # release lock
@@ -4,7 +4,7 @@ use warnings;
use base qw/Class::Component::Plugin/;
use LWP::UserAgent;
-sub check : Hook('check') {
+sub check : Hook {
my ($self, $context, $args) = @_;
my $conf = $self->config->{config};
@@ -4,7 +4,7 @@ use warnings;
use base qw/Class::Component::Plugin/;
use POSIX qw(getuid getpwuid);
-sub check :Hook('check') {
+sub check :Hook {
my ($self, $context, $args) = @_;
my $user = $self->config->{config}->{user};
@@ -4,7 +4,7 @@ use warnings;
use base qw/Class::Component::Plugin/;
use Data::Dumper;
-sub notify :Hook('notify') {
+sub notify :Hook {
my ($self, $context, $args) = @_;
warn Dumper($args);
@@ -6,7 +6,7 @@ use Params::Validate;
use MIME::Lite;
use DateTime;
-sub notify : Hook('notify') {
+sub notify : Hook {
my ($self, $context, $args) = @_;
my $conf = $self->{config}->{config};
@@ -5,7 +5,7 @@ use base qw/App::MadEye::Plugin::Base/;
use Text::Truncate qw/truncstr/;
use POE::Component::IKC::ClientLite;
-sub notify :Hook('notify') {
+sub notify :Hook {
my ($self, $context, $args) = @_;
my $config = $self->config->{config};
@@ -29,7 +29,7 @@ sub new {
$self;
}
-sub run_workers : Hook('before_run_jobs') {
+sub before_run_jobs : Hook {
my ($self, $context) = @_;
my @child_pids = $self->_run_workers($context);
@@ -93,7 +93,7 @@ sub run_job :Method {
);
}
-sub after_run_jobs : Hook('after_run_jobs') {
+sub after_run_jobs : Hook {
my ($self, $context, $args) = @_;
$context->log(debug => 'wait children!');

0 comments on commit 1e53d65

Please sign in to comment.