);
}
- method connect {
- return if $db;
-
- $db = DBI->connect( "dbi:Pg:dbname=" . $opt->db_path,
- $opt->db_user, $opt->db_password,
- { RaiseError => 1, PrintError => 0, AutoCommit => 1 } );
-
- $log->info( "Connected to database " . $opt->db_path );
- $generation = $self->get_option('generation');
- $log->debug("DB generation is $generation");
- }
-
method walk_unwanted_artists($callback) {
$self->connect;
return $count;
}
+ method connect {
+ return if $db;
+
+ $db = DBI->connect( "dbi:Pg:dbname=" . $opt->db_path,
+ $opt->db_user, $opt->db_password,
+ { RaiseError => 1, PrintError => 0, AutoCommit => 1 } );
+
+ $log->info( "Connected to database " . $opt->db_path );
+ $generation = $self->get_option('generation');
+ $log->debug("DB generation is $generation");
+ }
+
method disconnect {
return unless $db;