compare timestamps rathr than DateTime objects, it's easier to debug that way
[catagits/Catalyst-Plugin-Scheduler.git] / lib / Catalyst / Plugin / Scheduler / Base.pm
index 6b2f571..1a56b72 100755 (executable)
@@ -112,7 +112,7 @@ sub list_pending_events {
     
     ### there are no events scheduled?
     my @events  = $self->list_events or return;
-    my $now     = DateTime->now( time_zone => $tz );
+    my $now     = DateTime->now( time_zone => $tz )->epoch;
     
     ### list of pending events
     my @pending;
@@ -139,7 +139,7 @@ sub list_pending_events {
         ### we're due according to our cron-entry...
         if( $event->set ) {
             ### is the next run time now, or even before now?
-            push @pending, $event if $event->next_run_as_dt <= $now;
+            push @pending, $event if $event->next_run <= $now;
         }
     }