Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix: asynq redis db

wizardchenc2c4ee5777a5
diff --git a/internal/router/task.go b/internal/router/task.go
index 2836aad36..4df6f92fd 100644
--- a/internal/router/task.go
+++ b/internal/router/task.go
@@ -3,6 +3,7 @@ package router
import (
"log"
"os"
+ "strconv"
"time"
"github.com/Tencent/WeKnora/internal/types"
@@ -23,12 +24,18 @@ type AsynqTaskParams struct {
}
func getAsynqRedisClientOpt() *asynq.RedisClientOpt {
+ db := 0
+ if dbStr := os.Getenv("REDIS_DB"); dbStr != "" {
+ if parsed, err := strconv.Atoi(dbStr); err == nil {
+ db = parsed
+ }
+ }
opt := &asynq.RedisClientOpt{
Addr: os.Getenv("REDIS_ADDR"),
Password: os.Getenv("REDIS_PASSWORD"),
ReadTimeout: 100 * time.Millisecond,
WriteTimeout: 200 * time.Millisecond,
- DB: 0,
+ DB: db,
}
return opt
}