/[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 29 by dpavlin, Mon Feb 19 18:25:12 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;
33          $self->result->message( 'Found ' . $coll->count . ' results' );  
34            if ($results > 0) {
35            $self->result->message( "Found $results results" );
36    
37                  warn "### about to fork!";                  warn "### about to fork!";
38    
39                  if (fork) {                  if (fork) {
40                          my $t = $coll->count;                          my $t = $results;
41                          warn "### sleeping $t s...";                          warn "### sleeping $t s...";
42                          sleep $t;                          sleep $t;
43                          Grep::Event::Result->new({ coll => $coll, item_fragment => 'title' })->publish;                          warn "### pushing results for $q after $t s";
44    
45                            Jifty->log->error('result not collection but ', dump( $coll ))
46                                    unless ( $coll->isa('Jifty::Collection') );
47                            Grep::Event::Result->new({ q => $q, coll => $coll, item_fragment => 'long' })->publish;
48                          exit 0;                          exit 0;
49                  }                  }
50    

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

  ViewVC Help
Powered by ViewVC 1.1.26