From 32132f973eb3ca8e29d28be4e9a5bea87cb1038b Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 13 Jun 2011 18:07:03 +0200 Subject: add mongodb auth. Signed-off-by: franck cuny --- lib/GitHub/Collector/Role/MongoDB.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/GitHub') diff --git a/lib/GitHub/Collector/Role/MongoDB.pm b/lib/GitHub/Collector/Role/MongoDB.pm index e4cc5b1..1801e73 100644 --- a/lib/GitHub/Collector/Role/MongoDB.pm +++ b/lib/GitHub/Collector/Role/MongoDB.pm @@ -3,14 +3,21 @@ package GitHub::Collector::Role::MongoDB; use Moose::Role; use MongoDB; +has mongodb_auth => ( + is => 'ro', + isa => 'HashRef', + auto_deref => 1, + default => sub {{} }, +); + has mongodb => ( is => 'ro', isa => 'Object', lazy => 1, default => sub { my $self = shift; - my $conn = - MongoDB::Connection->new( timeout => 60000, query_timeout => 60000 ); + my $conn = MongoDB::Connection->new( + $self->mongodb_auth ); my $db = $conn->github; $self->_create_indexes($db); return $db; -- cgit v1.2.3