Skip to content

Commit

Permalink
Set context deadline to 3 seconds (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
coztekin committed Sep 14, 2023
1 parent 17f4a05 commit 0e8bf12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interactions/interactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ func (a *App) ProcessRequest(ctx context.Context, data []byte) (resp *objects.In

l.Debug().Msg("received request")

// Discord requires all interactions respond within 5 seconds
// Discord requires all interactions respond within 3 seconds
// so we may as well enforce this here
ctx, cancel := context.WithDeadline(ctx, time.Now().Add(5*time.Second))
ctx, cancel := context.WithDeadline(ctx, time.Now().Add(3*time.Second))
defer cancel()

switch req.Type {
Expand Down

0 comments on commit 0e8bf12

Please sign in to comment.