fix: review comments

Signed-off-by: Isma <71719097+Doozers@users.noreply.github.com>
This commit is contained in:
Isma 2023-12-22 10:59:17 +01:00 committed by mortimr
parent 9eef30aa38
commit baf56d0dd0
3 changed files with 3 additions and 7 deletions

1
.gitignore vendored
View file

@ -53,4 +53,3 @@ tests/spec-tests/
#pgeth #pgeth
!plugin/.gitkeep !plugin/.gitkeep
plugins/*/

View file

@ -56,8 +56,8 @@ func (p *PluginEngine) Version(ctx context.Context) error {
var plugins []*Plugin var plugins []*Plugin
// load monitoring plugin // load monitoring plugin
if pluginMonitoringDirectory := os.Getenv("PGETH_MONITORING_CONFIG"); len(pluginMonitoringDirectory) != 0 { if pluginConfigFile := os.Getenv("PGETH_MONITORING_CONFIG"); len(pluginConfigFile) != 0 {
monitoringDetails, err := p.loadPluginDetails(pluginMonitoringDirectory) monitoringDetails, err := p.loadPluginDetails(pluginConfigFile)
if err != nil { if err != nil {
return err return err
} }
@ -68,12 +68,11 @@ func (p *PluginEngine) Version(ctx context.Context) error {
}) })
} }
errChan := make(chan error)
for _, plug := range plugins { for _, plug := range plugins {
plug.Version() plug.Version()
} }
errChan := make(chan error)
go func() { go func() {
for { for {
select { select {
@ -111,7 +110,6 @@ func (p *PluginEngine) Start(ctx context.Context) error {
} }
errChan := make(chan error) errChan := make(chan error)
for _, plug := range plugins { for _, plug := range plugins {
go func(_plug *Plugin) { go func(_plug *Plugin) {
defer func() { defer func() {

View file

@ -1 +0,0 @@
plugin.so