Changeset 696

Show
Ignore:
Timestamp:
01/08/08 12:31:25 (10 months ago)
Author:
duncan
Message:

Stop exception when reload isnt in progress

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Ajax.pm

    r678 r696  
    6868sub reload_start_time : Local { 
    6969        my ($self, $c) = @_; 
    70         my $start = Opsview::Reloadtime->in_progress; 
    71         my $duration = Opsview::Reloadtime->average_duration; 
    72         my $end = DateTime->from_epoch( epoch => $start->epoch + $duration ); 
    73         $c->stash( ResultSet => {  
    74                 start_time => $start->epoch, 
    75                 end_time => $end->epoch, 
    76         } ); 
     70        my ($start, $duration, $end); 
     71        $start = Opsview::Reloadtime->in_progress; 
     72        $duration = Opsview::Reloadtime->average_duration; 
     73        if($start && $duration) { 
     74                $end = DateTime->from_epoch( epoch => $start->epoch + $duration ); 
     75                $c->stash( ResultSet => {  
     76                        start_time => $start->epoch, 
     77                        end_time => $end->epoch, 
     78                } ); 
     79        } 
    7780} 
    7881