mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 18:53:43 +08:00
opt: merge RAG branch
This commit is contained in:
@@ -29,7 +29,7 @@ func NewServicePool(db *gorm.DB, redisCli *redis.Client, manager *oss.UploaderMa
|
||||
|
||||
name := fmt.Sprintf("MjService-%d", k)
|
||||
// create mj service
|
||||
service := NewService(name, queue, 4, 600, db, client, manager, appConfig)
|
||||
service := NewService(name, queue, 4, 600, db, client, manager, appConfig.ProxyURL)
|
||||
botName := fmt.Sprintf("MjBot-%d", k)
|
||||
bot, err := NewBot(botName, appConfig.ProxyURL, &config, service)
|
||||
if err != nil {
|
||||
|
||||
@@ -25,7 +25,7 @@ type Service struct {
|
||||
taskTimeout int64
|
||||
}
|
||||
|
||||
func NewService(name string, queue *store.RedisQueue, maxTaskNum int32, timeout int64, db *gorm.DB, client *Client, manager *oss.UploaderManager, config *types.AppConfig) *Service {
|
||||
func NewService(name string, queue *store.RedisQueue, maxTaskNum int32, timeout int64, db *gorm.DB, client *Client, manager *oss.UploaderManager, proxy string) *Service {
|
||||
return &Service{
|
||||
name: name,
|
||||
db: db,
|
||||
@@ -34,7 +34,7 @@ func NewService(name string, queue *store.RedisQueue, maxTaskNum int32, timeout
|
||||
uploadManager: manager,
|
||||
taskTimeout: timeout,
|
||||
maxHandleTaskNum: maxTaskNum,
|
||||
proxyURL: config.ProxyURL,
|
||||
proxyURL: proxy,
|
||||
taskStartTimes: make(map[int]time.Time, 0),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user