Skip to content

Commit

Permalink
Add 5 seconds timeout for status
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jan 3, 2024
1 parent f743cec commit 49ec815
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
package status

import (
"context"
"net/http"
"sync"
"time"

"github.com/cozy/cozy-stack/pkg/assets/dynamic"
"github.com/cozy/cozy-stack/pkg/config/config"
Expand All @@ -23,7 +25,8 @@ func Status(c echo.Context) error {
var wg sync.WaitGroup
wg.Add(3)

ctx := c.Request().Context()
ctx, cancel := context.WithTimeout(c.Request().Context(), 5*time.Second)
defer cancel()

go func() {
cfg := config.GetConfig()
Expand Down

0 comments on commit 49ec815

Please sign in to comment.