diff options
-rw-r--r-- | plugins/http/plugin.go | 6 | ||||
-rw-r--r-- | tests/plugins/reload/reload_plugin_test.go | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index 403f8fd1..01bd243f 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -393,9 +393,8 @@ func (s *Plugin) Reset() error { return errors.E(op, err) } - s.log.Info("HTTP listeners successfully re-added") - s.log.Info("HTTP workers Pool successfully restarted") + s.handler, err = NewHandler( s.cfg.MaxRequestSize, *s.cfg.Uploads, @@ -406,6 +405,9 @@ func (s *Plugin) Reset() error { return errors.E(op, err) } + s.log.Info("HTTP handler listeners successfully re-added") + s.handler.AddListener(s.logCallback) + s.log.Info("HTTP plugin successfully restarted") return nil } diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go index dcbedb0f..6db7b6d0 100644 --- a/tests/plugins/reload/reload_plugin_test.go +++ b/tests/plugins/reload/reload_plugin_test.go @@ -54,7 +54,7 @@ func TestReloadInit(t *testing.T) { mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).Times(2) mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1) mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1) - mockLogger.EXPECT().Info("HTTP listeners successfully re-added").Times(1) + mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").Times(1) mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror @@ -150,7 +150,7 @@ func TestReloadHugeNumberOfFiles(t *testing.T) { mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1) mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1) mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1) - mockLogger.EXPECT().Info("HTTP listeners successfully re-added").MinTimes(1) + mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1) mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror @@ -259,7 +259,7 @@ func TestReloadFilterFileExt(t *testing.T) { mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).AnyTimes() mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1) mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1) - mockLogger.EXPECT().Info("HTTP listeners successfully re-added").Times(1) + mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1) mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror @@ -389,7 +389,7 @@ func TestReloadCopy100(t *testing.T) { mockLogger.EXPECT().Debug("file was updated", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50) mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1) mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1) - mockLogger.EXPECT().Info("HTTP listeners successfully re-added").MinTimes(1) + mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1) mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror |