Skip to content

Commit

Permalink
fix: change log compact function and setupModule state bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbajoe committed May 20, 2024
1 parent addfc0d commit b231146
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/change_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ START:
if prevLog.Cmd.IsNoop() {
removeList = append(removeList, prevLog)
logs = append(logs[:i-1], logs[i:]...)
continue
goto START
}

commonResource := prevLog.Cmd.Resource() == curLog.Cmd.Resource()
Expand Down
9 changes: 0 additions & 9 deletions internal/proxy/dynamic_proxy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package proxy

import (
"context"
"errors"
"fmt"
"log"
Expand All @@ -19,7 +18,6 @@ import (
"github.com/rs/zerolog"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"golang.org/x/sync/errgroup"
)

func (state *ProxyState) reconfigureState(init bool, _ *spec.ChangeLog) error {
Expand All @@ -46,9 +44,7 @@ func (state *ProxyState) reconfigureState(init bool, _ *spec.ChangeLog) error {

func (ps *ProxyState) setupModules() error {
ps.logger.Debug().Msg("Setting up modules")
eg, _ := errgroup.WithContext(context.TODO())
for _, route := range ps.rm.GetRoutes() {
route := route
if len(route.Modules) > 0 {
mod := route.Modules[0]
var (
Expand Down Expand Up @@ -84,13 +80,8 @@ func (ps *ProxyState) setupModules() error {
elapsed := time.Since(start)
ps.logger.Debug().
Msgf("Module '%s/%s' changed applied in %s", mod.Name, mod.Namespace.Name, elapsed)
return nil
}
}
if err := eg.Wait(); err != nil {
ps.logger.Err(err).Msg("Error setting up modules")
return err
}
return nil
}

Expand Down

0 comments on commit b231146

Please sign in to comment.