Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing TrafficController to manage TrafficGate and Pipeline #55

Merged
merged 4 commits into from
Jun 24, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[api]: Clean some message of api
  • Loading branch information
xxx7xxxx committed Jun 22, 2021
commit bbcf54416f60e49ff95fe66aa7167632f38c8802
6 changes: 2 additions & 4 deletions pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"time"

"github.com/go-chi/chi/v5"
"go.uber.org/zap"

"github.com/megaease/easegress/pkg/cluster"
"github.com/megaease/easegress/pkg/logger"
Expand Down Expand Up @@ -91,15 +90,14 @@ func MustNewServer(opt *option.Options, cluster cluster.Cluster) *Server {
func (s *Server) Close(wg *sync.WaitGroup) {
defer wg.Done()

// Give the server a bit to close connections
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

if err := s.srv.Shutdown(ctx); err != nil {
logger.Errorf("Could not gracefully shutdown the server", zap.Error(err))
logger.Errorf("gracefully shutdown the server failed: %v", err)
}

logger.Infof("Server stopped")
logger.Infof("server stopped")
}

func (s *Server) getMutex() (cluster.Mutex, error) {
Expand Down