From d319ec001d930770c9eabb8c1fb7ec91bc233020 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 29 Sep 2023 07:44:49 +0200 Subject: [PATCH 1/2] Activate debug logging --- internal/notify/http.go | 1 + main.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/internal/notify/http.go b/internal/notify/http.go index a0be944..c67a084 100644 --- a/internal/notify/http.go +++ b/internal/notify/http.go @@ -46,6 +46,7 @@ func HandleReceive(mux *http.ServeMux, notify Receiver, auth icchttp.Authenticat cid, next := notify.Receive(meetingID, uid) icclog.Debug("HTTP Recieve from user %d, channel id: %s", uid, cid) + defer icclog.Debug("Closed HTTP Recieve from user %d, channel id: %s", uid, cid) // Send channel id. if _, err := fmt.Fprintf(w, `{"channel_id": "%s"}`+"\n", cid); err != nil { diff --git a/main.go b/main.go index 7721ba9..254b29f 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "os" + "strconv" "github.com/OpenSlides/openslides-autoupdate-service/pkg/auth" "github.com/OpenSlides/openslides-autoupdate-service/pkg/environment" @@ -98,6 +99,10 @@ func buildDocu() error { // // Returns a the service as callable. func initService(lookup environment.Environmenter) (func(context.Context) error, error) { + if devMode, _ := strconv.ParseBool(environment.EnvDevelopment.Value(lookup)); devMode { + icclog.SetDebugLogger(log.Default()) + } + var backgroundTasks []func(context.Context, func(error)) listenAddr := ":" + envICCServicePort.Value(lookup) From 8f28f6af3aab058064341f588333ff3c060ad69a Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 29 Sep 2023 07:46:52 +0200 Subject: [PATCH 2/2] Run go generate --- environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.md b/environment.md index 80d420d..e8ddaf8 100644 --- a/environment.md +++ b/environment.md @@ -5,10 +5,10 @@ The Service uses the following environment variables: +* `OPENSLIDES_DEVELOPMENT`: If set, the service uses the default secrets. The default is `false`. * `ICC_PORT`: Port on which the service listen on. The default is `9007`. * `MESSAGE_BUS_HOST`: Host of the redis server. The default is `localhost`. * `MESSAGE_BUS_PORT`: Port of the redis server. The default is `6379`. -* `OPENSLIDES_DEVELOPMENT`: If set, the service uses the default secrets. The default is `false`. * `DATABASE_PASSWORD_FILE`: Postgres Password. The default is `/run/secrets/postgres_password`. * `DATABASE_USER`: Postgres Database. The default is `openslides`. * `DATABASE_HOST`: Postgres Host. The default is `localhost`.