/[Grep]/lib/Grep/Action/Search.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Grep/Action/Search.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 28 by dpavlin, Mon Feb 19 16:28:00 2007 UTC revision 30 by dpavlin, Mon Feb 19 20:07:48 2007 UTC
# Line 20  use Time::HiRes qw/time/; Line 20  use Time::HiRes qw/time/;
20  sub take_action {  sub take_action {
21      my $self = shift;      my $self = shift;
22    
23            my $q = $self->argument_value('content_contains') || warn "can't find content_contains";
24    
25          $self->SUPER::take_action( @_ );          $self->SUPER::take_action( @_ );
26    
27          my $coll = $self->result->content('search');          my $coll = $self->result->content('search');
# Line 27  sub take_action { Line 29  sub take_action {
29          Jifty->log->error('result not collection but ', dump( $coll ))          Jifty->log->error('result not collection but ', dump( $coll ))
30                  unless ( $coll->isa('Jifty::Collection') );                  unless ( $coll->isa('Jifty::Collection') );
31    
32          if ($coll->count > 0) {          my $results = $coll->count;
         $self->result->message( 'Found ' . $coll->count . ' results' );  
   
                 warn "### about to fork!";  
   
                 if (fork) {  
                         my $t = $coll->count;  
                         warn "### sleeping $t s...";  
                         sleep $t;  
                         Grep::Event::Result->new({ coll => $coll, item_fragment => 'title' })->publish;  
                         exit 0;  
                 }  
33    
34            if ($results > 0) {
35            $self->result->message( "Found $results results" );
36          } else {          } else {
37                  $self->result->error('No local results found, wait for remote results to arrive...');                  $self->result->error('No local results found, wait for remote results to arrive...');
38          }          }

Legend:
Removed from v.28  
changed lines
  Added in v.30

  ViewVC Help
Powered by ViewVC 1.1.26