/[pxelator]/lib/PXElator/store.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/PXElator/store.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 504 by dpavlin, Sun Jan 31 18:28:38 2010 UTC revision 505 by dpavlin, Wed Jul 21 15:34:34 2010 UTC
# Line 7  use POSIX; Line 7  use POSIX;
7  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
8  use Data::Dump qw(dump);  use Data::Dump qw(dump);
9    
 #use CouchDB;  
   
10  use MongoDB;  use MongoDB;
11    
12  my $conn = MongoDB::Connection->new;  our $audit;
13  our $db = $conn->get_database( 'pxelator' );  
14  our $audit = $db->get_collection( 'audit' );  eval {
15            my $conn   = MongoDB::Connection->new;
16            my  $db    = $conn->get_database( 'pxelator' );
17            $audit = $db->get_collection( 'audit' );
18    };
19    warn "ERROR: no store for audit: $@" if $@;
20    
21    
22  sub audit {  sub audit {
# Line 57  sub audit { Line 60  sub audit {
60  #       CouchDB::_store_audit( "$time.$package.$url" => $data );  #       CouchDB::_store_audit( "$time.$package.$url" => $data );
61    
62  #       $data->{_id} = "$time.$package.$url";  #       $data->{_id} = "$time.$package.$url";
63          $audit->insert( $data );  #
64            if ( $audit ) {
65                    $audit->insert( $data );
66            } else {
67                    warn "AUDIT ",dump($data);
68            }
69  }  }
70    
71    

Legend:
Removed from v.504  
changed lines
  Added in v.505

  ViewVC Help
Powered by ViewVC 1.1.26