Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/watcher/watcher_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,6 @@ func (w *Watcher) handleEnableWatchers(ctx context.Context, msg *bus.Message) {
instanceID := enableWatchersMessage.InstanceID
configContext := enableWatchersMessage.ConfigContext

// if config apply ended in a reload there is no need to reparse the config so an empty config context is sent
// from the file plugin
if configContext.InstanceID != "" {
w.instanceWatcherService.HandleNginxConfigContextUpdate(ctx, instanceID, configContext)
}

w.watcherMutex.Lock()
w.instancesWithConfigApplyInProgress = slices.DeleteFunc(
w.instancesWithConfigApplyInProgress,
Expand All @@ -203,6 +197,12 @@ func (w *Watcher) handleEnableWatchers(ctx context.Context, msg *bus.Message) {
w.fileWatcherService.EnableWatcher(ctx)
w.instanceWatcherService.SetEnabled(true)
w.watcherMutex.Unlock()

// if config apply ended in a reload there is no need to reparse the config so an empty config context is sent
// from the file plugin
if configContext.InstanceID != "" {
w.instanceWatcherService.HandleNginxConfigContextUpdate(ctx, instanceID, configContext)
}
}

func (w *Watcher) handleConfigApplyRequest(ctx context.Context, msg *bus.Message) {
Expand Down
Loading