抽取数据添加协程
This commit is contained in:
@@ -30,12 +30,24 @@ func main() {
|
||||
SelectColumns: []string{"impression", "click", "cost", "t0GMV"},
|
||||
GroupType: 1,
|
||||
QueryVersion: 1,
|
||||
PageInfo: &sync.PageInfo{
|
||||
CurrentPage: 1,
|
||||
PageSize: 10,
|
||||
},
|
||||
}
|
||||
|
||||
logrus.Infof("=== 开始执行定时同步任务 ===")
|
||||
logrus.Infof("时间区间:%s ~ %s", lastHourStart.Format("2006-01-02 15:04:05"), lastHourEnd.Format("2006-01-02 15:04:05"))
|
||||
config := sync.ConcurrentSyncConfig{
|
||||
MaxConcurrency: 5,
|
||||
UseMock: true,
|
||||
MaxRetries: 3,
|
||||
}
|
||||
|
||||
result, err := syncService.SyncAccountReportWithPagination(ctx, req, true, 3)
|
||||
logrus.Infof("=== 开始执行定时同步任务(并发模式)===")
|
||||
logrus.Infof("时间区间:%s ~ %s", lastHourStart.Format("2006-01-02 15:04:05"), lastHourEnd.Format("2006-01-02 15:04:05"))
|
||||
logrus.Infof("分页配置:每页大小=%d", req.PageInfo.PageSize)
|
||||
logrus.Infof("并发配置:最大并发数=%d, 最大重试次数=%d", config.MaxConcurrency, config.MaxRetries)
|
||||
|
||||
result, err := syncService.SyncAccountReportConcurrent(ctx, req, config)
|
||||
if err != nil {
|
||||
logrus.Errorf("定时同步任务执行完成,存在失败的页面")
|
||||
logrus.Infof("主任务日志ID:%d", result.TaskLogID)
|
||||
|
||||
Reference in New Issue
Block a user