[ 
https://issues.apache.org/jira/browse/BEAM-13124?focusedWorklogId=698778&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-698778
 ]

ASF GitHub Bot logged work on BEAM-13124:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Dec/21 15:37
            Start Date: 20/Dec/21 15:37
    Worklog Time Spent: 10m 
      Work Description: AydarZaynutdinov commented on a change in pull request 
#16277:
URL: https://github.com/apache/beam/pull/16277#discussion_r772464747



##########
File path: playground/backend/cmd/server/http.go
##########
@@ -19,12 +19,28 @@ import (
        "beam.apache.org/playground/backend/internal/logger"
        "context"
        "net/http"
+       "os"
+       "path/filepath"
 )
 
 // listenHttp binds the http.Handler on the TCP network address
-func listenHttp(ctx context.Context, errChan chan error, envs 
environment.NetworkEnvs, handler http.Handler) {
-       logger.Infof("listening HTTP at %s\n", envs.Address())
-       if err := http.ListenAndServe(envs.Address(), handler); err != nil {
+func listenHttp(ctx context.Context, errChan chan error, envs 
*environment.Environment, handler http.Handler) {
+       address := envs.NetworkEnvs.Address()
+       logger.Infof("listening HTTP at %s\n", address)
+
+       mux := http.NewServeMux()
+       mux.Handle("/", handler)
+       mux.HandleFunc("/readiness", func(w http.ResponseWriter, r 
*http.Request) {

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 698778)
    Time Spent: 2h  (was: 1h 50m)

> [Playground] Create readiness endpoint
> --------------------------------------
>
>                 Key: BEAM-13124
>                 URL: https://issues.apache.org/jira/browse/BEAM-13124
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-playground
>            Reporter: Artur Khanin
>            Assignee: Aydar Zaynutdinov
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-beta-launch, 
> beam-playground-sprint-5
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Need to add a new endpoint to check the instance's readiness. If the instance 
> is ready to receive one more code to process it this endpoint should return 
> status 200, in another case, it returns some error status (423 for example).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to