diff --git a/META.json b/META.json index 8325d50..1911aa8 100644 --- a/META.json +++ b/META.json @@ -43,7 +43,7 @@ "runtime" : { "requires" : { "Algorithm::Cron" : "0.10", - "Mojolicious" : "9.35", + "Mojolicious" : "9.37", "perl" : "5.020001" } }, @@ -73,6 +73,7 @@ "Daniel Mantovani ", "Mohammad S Anwar ", "Sébastien Feugère ", + "rawleyfowler ", "vagrant " ], "x_serialization_backend" : "JSON::PP version 4.07", diff --git a/README.md b/README.md index 4bd628f..36ea4f5 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ of simultaneous scheduled tasks to just one on a multi-host environment. # Execute some job every 5 minutes, only on one of the existing hosts plugin Cron => ( '*/5 * * * *' => sub { - my $target_epoch = shift; + my ($target_epoch, $app) = @_; my $last_epoch = some_kind_of_atomic_swap_function( key => "some id key for this crontab", value => $target_epoch diff --git a/lib/Mojolicious/Plugin/Cron.pm b/lib/Mojolicious/Plugin/Cron.pm index b2fa665..a59f5bb 100644 --- a/lib/Mojolicious/Plugin/Cron.pm +++ b/lib/Mojolicious/Plugin/Cron.pm @@ -28,7 +28,8 @@ sub register { # special case, plugin => 'mm hh dd ...' => sub {} $self->_cron($app->moniker, - {crontab => (keys %$cronhashes)[0], code => (values %$cronhashes)[0]}, $app); + {crontab => (keys %$cronhashes)[0], code => (values %$cronhashes)[0]}, + $app); } else { $self->_cron($_, $cronhashes->{$_}, $app) for keys %$cronhashes;