feat: add request timeout
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.bissendorf.co/bissendorf/unifood/m/v2/core/interfaces"
|
||||
"git.bissendorf.co/bissendorf/unifood/m/v2/core/interfaces/params"
|
||||
@ -92,6 +93,8 @@ func getVerbs(ctx context.Context, config *AppConfig) (commands []*cobra.Command
|
||||
}
|
||||
logger := jlog.New(logLevel)
|
||||
ctx := jlog.ContextWith(context.Background(), logger)
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Duration(config.RequestTimeoutSeconds)*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// Print config
|
||||
if config.PrintConfig {
|
||||
|
||||
Reference in New Issue
Block a user