Skip to content

Commit f1170bd

Browse files
committed
chore(workers): provide HTTP invoke timeout through env
1 parent cf71a2c commit f1170bd

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

services/fission-rmq-connector/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ var (
6161
HTTP_ENDPOINT = env.Must("HTTP_ENDPOINT")
6262
MAX_RETRIES = env.CouldInt("MAX_RETRIES", 3)
6363
METRICS_ADDR = env.Could("METRICS_ADDR", ":2112")
64+
HTTP_TIMEOUT = time.Duration(env.CouldInt("HTTP_TIMEOUT", 120)) * time.Second
6465
)
6566

6667
func Run(cleanup cleanupper.Cleanupper) error {
@@ -119,7 +120,7 @@ func setupMetrics(cleanup cleanupper.Cleanupper) error {
119120
func buildProcessor(publish chan<- mq.PublishMessage) mq.ProcessorFuncBuilder {
120121
return func() mq.ProcessorFunc {
121122
client := &http.Client{
122-
Timeout: 10 * time.Second,
123+
Timeout: HTTP_TIMEOUT,
123124
}
124125
return func(incoming amqp091.Delivery) error {
125126
opsReceived.Inc()

services/fission-user-workers/service/ctrl_k8s.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ func (ctrl *KubernetesController) workerToMessageQueueTrigger(worker UserWorker)
310310
Name: "EXCHANGE",
311311
Value: ctrl.mqtExchange,
312312
},
313+
{
314+
Name: "HTTP_TIMEOUT",
315+
Value: env.Could("CTRL_K8S_MQT_HTTP_TIMEOUT", ""),
316+
},
313317
},
314318
},
315319
},

0 commit comments

Comments
 (0)