33 |
|
|
34 |
if ($results > 0) { |
if ($results > 0) { |
35 |
$self->result->message( "Found $results results" ); |
$self->result->message( "Found $results results" ); |
|
|
|
|
warn "### about to fork!"; |
|
|
|
|
|
if (fork) { |
|
|
my $t = $results; |
|
|
warn "### sleeping $t s..."; |
|
|
sleep $t; |
|
|
warn "### pushing results for $q after $t s"; |
|
|
|
|
|
Jifty->log->error('result not collection but ', dump( $coll )) |
|
|
unless ( $coll->isa('Jifty::Collection') ); |
|
|
Grep::Event::Result->new({ q => $q, coll => $coll, item_fragment => 'long' })->publish; |
|
|
exit 0; |
|
|
} |
|
|
|
|
36 |
} else { |
} else { |
37 |
$self->result->error('No local results found, wait for remote results to arrive...'); |
$self->result->error('No local results, try remote feeds...'); |
38 |
} |
} |
39 |
|
|
40 |
return $coll; |
return $coll; |