Skip to content

Commit

Permalink
Merge pull request #34 from BuoyantIO/flynn/cleanup
Browse files Browse the repository at this point in the history
Minor (but important!) cleanup
  • Loading branch information
kflynn authored Oct 29, 2024
2 parents 99fab62 + e908a99 commit 4236b81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/faces/color_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func (cprv *ColorProvider) Get(row, col int) ProviderResponse {
cprv.CheckUnlatch(start)
rstat := cprv.CheckRequestStatus()

cprv.DelayIfNeeded()

if rstat.IsRateLimited() {
cprv.Warnf("RATELIMIT(%d, %d) => %s\n", row, col, rstat.Message())

Expand Down
8 changes: 5 additions & 3 deletions pkg/faces/faceserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func (srv *FaceServer) SetupFromEnvironment() {
}
}

fmt.Printf("%s %s: smileyService %v\n", time.Now().Format(time.RFC3339), srv.Name, srv.smileyService)
fmt.Printf("%s %s: colorService %v\n", time.Now().Format(time.RFC3339), srv.Name, srv.colorService)
fmt.Printf("%s %s: smileyService http://%s\n", time.Now().Format(time.RFC3339), srv.Name, srv.smileyService)
fmt.Printf("%s %s: colorService grpc://%s\n", time.Now().Format(time.RFC3339), srv.Name, srv.colorService)
}

func (srv *FaceServer) makeRequest(user string, userAgent string, service string, keyword string, subrequest string, row int, col int) *FaceResponse {
Expand Down Expand Up @@ -204,7 +204,9 @@ func (srv *FaceServer) faceGetHandler(r *http.Request, rstat *BaseRequestStatus)
StatusCode: http.StatusOK,
}

fmt.Printf("%s %s: request path: %s, query string: %s\n", time.Now().Format(time.RFC3339), srv.Name, r.URL.Path, r.URL.RawQuery)
if srv.debugEnabled {
fmt.Printf("%s %s: request path: %s, query string: %s\n", time.Now().Format(time.RFC3339), srv.Name, r.URL.Path, r.URL.RawQuery)
}

// Our request URL should start with /center/ or /edge/, and we want to
// propagate that to our smiley and color services.
Expand Down

0 comments on commit 4236b81

Please sign in to comment.