feat: add img_calls field for recharge products

This commit is contained in:
RockYang
2023-12-15 16:56:56 +08:00
parent d974b1ff0e
commit 45cb29d9a0
13 changed files with 83 additions and 41 deletions

View File

@@ -28,7 +28,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 {

View File

@@ -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),
}
}