From: Marius Gavrilescu Date: Thu, 22 Jan 2015 21:41:16 +0000 (+0200) Subject: Do not load Gruntmaster::Data if not needed X-Git-Tag: 5999.000_005~101 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=55e61ae897ee944a61d1a822170027cd376cec2a;p=gruntmaster-daemon.git Do not load Gruntmaster::Data if not needed --- diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index 681a141..a84fc57 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -8,7 +8,6 @@ our $VERSION = '5999.000_004'; use Gruntmaster::Daemon::Constants qw/ERR/; use Gruntmaster::Daemon::Format qw/prepare_files/; -use Gruntmaster::Data; use File::Basename qw/fileparse/; use File::Temp qw/tempdir/; @@ -34,6 +33,8 @@ use constant FORMAT_EXTENSION => { ################################################## +sub purge; + my $db; sub safe_can_nodie { @@ -168,6 +169,7 @@ sub got_job{ } sub run{ + require Gruntmaster::Data; $db = Gruntmaster::Data->connect('dbi:Pg:'); Log::Log4perl->init('/etc/gruntmasterd/gruntmasterd-log.conf'); get_logger->info("gruntmasterd $VERSION started");