--- lib/PXElator/store.pm 2010/01/31 18:28:38 497 +++ lib/PXElator/store.pm 2010/07/21 15:34:34 505 @@ -7,13 +7,16 @@ use Time::HiRes qw/time/; use Data::Dump qw(dump); -#use CouchDB; - use MongoDB; -my $conn = MongoDB::Connection->new; -our $db = $conn->get_database( 'pxelator' ); -our $audit = $db->get_collection( 'audit' ); +our $audit; + +eval { + my $conn = MongoDB::Connection->new; + my $db = $conn->get_database( 'pxelator' ); + $audit = $db->get_collection( 'audit' ); +}; +warn "ERROR: no store for audit: $@" if $@; sub audit { @@ -57,7 +60,12 @@ # CouchDB::_store_audit( "$time.$package.$url" => $data ); # $data->{_id} = "$time.$package.$url"; - $audit->insert( $data ); +# + if ( $audit ) { + $audit->insert( $data ); + } else { + warn "AUDIT ",dump($data); + } }