diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/MQTT.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/MQTT.pm index 0416d4df55ce2d8009386003fe4490d93a750e3c..83754a72a2efbeb5c4973ec850a31225b318d067 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/MQTT.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/MQTT.pm @@ -1,12 +1,14 @@ package Lemonldap::NG::Common::MessageBroker::MQTT; use strict; -use Net::MQTT::Simple; our $VERSION = '2.20.0'; sub new { my ( $class, $conf, $logger ) = @_; + + require Net::MQTT::Simple; + my $args = $conf->{messageBrokerOptions}; $args //= {}; $args->{server} ||= 'localhost:1883'; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Pg.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Pg.pm index e15e9d0f479f672c67386bece42eb7c720daa946..dcd21f7f6417c848706631eca367b7efceb82e80 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Pg.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Pg.pm @@ -1,13 +1,13 @@ package Lemonldap::NG::Common::MessageBroker::Pg; use strict; -use DBI; use JSON; our $VERSION = '2.20.0'; sub new { my ( $class, $conf, $logger ) = @_; + require DBI; my $args = $conf->{messageBrokerOptions}; unless ($args and $args->{dbiChain} diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Redis.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Redis.pm index e444395b72b4ace10a0865f4abc15bf29257a089..4a2b53fdc5c85c6c4b33e81e2f363529e343cc98 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Redis.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/MessageBroker/Redis.pm @@ -1,13 +1,13 @@ package Lemonldap::NG::Common::MessageBroker::Redis; use strict; -use Redis; use JSON; our $VERSION = '2.20.0'; sub new { my ( $class, $conf, $logger ) = @_; + require Redis; my $self = bless { logger => $logger }, $class; my $args = $conf->{messageBrokerOptions} // {};