From ca311b5e1ab05f05bf44d402e49937ad8a668f29 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 7 Dec 2010 19:36:59 +0100 Subject: [PATCH] silently skip empty chunks --- couchdb-trigger.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/couchdb-trigger.pl b/couchdb-trigger.pl index 873beee..77fa41c 100755 --- a/couchdb-trigger.pl +++ b/couchdb-trigger.pl @@ -46,12 +46,9 @@ while( ! $error ) { $tx->res->body(sub{ my ( $content, $body ) = @_; - debug 'BODY' => $body; + return if length($body) == 0; # empty chunk, heartbeat? - if ( length($body) == 0 ) { - warn "# empty chunk, heartbeat?\n"; - return; - } + debug 'BODY' => $body; foreach ( split(/\r?\n/, $body) ) { # we can get multiple documents in one chunk -- 2.20.1