event, the last time it ran, and the last output or error.
- Store the last runtime and last output from each event for
display in scheduler_state/dump_these.
+ - Added additional YAML tests.
0.05 2005-12-29 15:50:00
- Fixed bug when using @monthly.
for my $event ( @{ $c->_events } ) {
my $next_run;
- if ( $event->{trigger}
+ if ( $event->{trigger} && $c->req->params->{schedule_trigger}
&& $event->{trigger} eq $c->req->params->{schedule_trigger} )
{
= $c->_event_state->{events}->{ $event->{event} }->{last_run};
if ( $last_run ) {
$last_run = DateTime->from_epoch(
- epoch => $last_run,
+ epoch => $last_run,
time_zone => $conf->{time_zone},
);
$dump->{last_run}
if ( $mtime > $c->_event_state->{yaml_mtime}->{$$} ) {
$c->_event_state->{yaml_mtime}->{$$} = $mtime;
- # clean up old PID files listed in yaml_mtime
+ # clean up old PIDs listed in yaml_mtime
foreach my $pid ( keys %{ $c->_event_state->{yaml_mtime} } ) {
if ( $c->_event_state->{yaml_mtime}->{$pid} < $mtime ) {
delete $c->_event_state->{yaml_mtime}->{$pid};
use Test::More;
use Storable qw/lock_store lock_retrieve/;
-plan tests => 3;
+plan tests => 6;
use Catalyst::Test 'TestApp';
our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
unlink "$FindBin::Bin/lib/TestApp/every_minute.log";
}
+# test that a YAML trigger works
+{
+ ok( my $res = request('http://localhost/?schedule_trigger=some_long_trigger_name'), 'request ok' );
+ is( $res->content, 'default', 'response ok' );
+ is( -e "$FindBin::Bin/lib/TestApp/every_minute.log", 1, 'every_minute executed ok' );
+ unlink "$FindBin::Bin/lib/TestApp/every_minute.log";
+}
+
---
- at: '* * * * *'
event: /cron/every_minute
-
+ trigger: some_long_trigger_name