Plugins: Add isEnabled method
Plugins are now disabled at startup time unless there is some relevant configuration in hydra.conf. This avoids hydra-notify having to do a lot of redundant work (a lot of plugins did a lot of database queries *before* deciding they were disabled). Note: BitBucketStatus users will need to add 'enable_bitbucket_status = 1' to hydra.conf.
This commit is contained in:
@ -12,11 +12,15 @@ sub new {
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub isEnabled {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub instantiate {
|
||||
my ($class, %args) = @_;
|
||||
my $plugins = [];
|
||||
$args{plugins} = $plugins;
|
||||
push @$plugins, $class->plugins(%args);
|
||||
push @$plugins, grep { $_->isEnabled } $class->plugins(%args);
|
||||
return @$plugins;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user