$url ||= 'http://localhost:5984/monitor';
$trigger_path ||= 'trigger/shell.pm' ;
+our $database = $1 if $url =~ m{/(\w+)/?$};
+
sub commit { warn "# commit ignored\n"; }
require $trigger_path if -e $trigger_path;
if ( $tx->res->code == 409 ) {
info "TRIGGER ABORTED started on another worker? ", $tx->error;
} else {
- info "ERROR ", $tx->error;
+ info "ERROR $url/$id ", $tx->error;
}
} else {
my $res = $tx->res->json;
$client->put( "$url/$id" => $json->encode( $change->{doc} ) => sub {
my ($client,$tx) = @_;
if ($tx->error) {
- info "ERROR", $tx->error;
+ info "ERROR $url/$id", $tx->error;
} else {
my $res = $tx->res->json;
$change->{doc}->{_rev} = $res->{rev};