From: Marius Gavrilescu Date: Fri, 30 Jan 2015 12:05:12 +0000 (+0200) Subject: Connect to $ENV{GRUNTMASTER_DSN} if defined X-Git-Tag: 5999.000_005~69 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=9a69bbad177308e296d1dfc3486bcbcdb966de0c;p=gruntmaster-daemon.git Connect to $ENV{GRUNTMASTER_DSN} if defined --- diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index ed24158..f222500 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -163,7 +163,7 @@ sub got_job{ sub run{ warn "No GRUNTMASTER_VM environment variable. Running without a VM is a security risk.\n" unless $ENV{GRUNTMASTER_VM}; require Gruntmaster::Data; - $db = Gruntmaster::Data->connect('dbi:Pg:'); + $db = Gruntmaster::Data->connect($ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'); Log::Log4perl->init('/etc/gruntmasterd/gruntmasterd-log.conf'); get_logger->info("gruntmasterd $VERSION started"); chdir tempdir 'gruntmasterd.XXXX', CLEANUP => 1, TMPDIR => 1;