Skip to content

Commit

Permalink
fix : directory & remove docker
Browse files Browse the repository at this point in the history
  • Loading branch information
seipan committed Oct 5, 2023
1 parent 7d6516d commit cdf9c29
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 51 deletions.
26 changes: 0 additions & 26 deletions Dockerfile

This file was deleted.

17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
DOCKER_COMPOSE_LOCAL_SERVER := docker-compose.yml

.PHONY: ts-re
ts-re:
Expand All @@ -8,18 +7,6 @@ ts-re:
ts-down:
cd testserver && make down

.PHONY: up
.PHONY: run
up:
docker-compose \
-f $(DOCKER_COMPOSE_LOCAL_SERVER) up -d


.PHONY: down
down:
docker-compose \
-f $(DOCKER_COMPOSE_LOCAL_SERVER) down \
--rmi all --volumes --remove-orphans


.PHONY: re
re:down up
go run .
10 changes: 0 additions & 10 deletions docker-compose.yml

This file was deleted.

6 changes: 6 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"net/http"

"github.com/seipan/mylb/serverpool"
"github.com/seipan/mylb/utils"
"go.uber.org/zap"
)

type LBHandler interface {
Expand All @@ -17,6 +19,10 @@ type lbHandler struct {
func (lb *lbHandler) Serve(w http.ResponseWriter, r *http.Request) {
peer := lb.serverPool.GetNextValidPeer()
if peer != nil {
utils.Info("access to endpoint",
zap.String("url", peer.GetURL()),
zap.Int("connections", peer.GetConnections()),
)
peer.Serve(w, r)
return
}
Expand Down

0 comments on commit cdf9c29

Please sign in to comment.