作者 陈志颖

test:分红 预算

... ... @@ -901,6 +901,11 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
if dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
endSave := time.Since(startSave)
log.Logger.Info("保存预算单耗时", map[string]interface{}{
"保存预算单耗时": endSave.Seconds(),
})
// 获取产品ID
orderGoodSavedIds := make([]int64, 0)
for _, dividendsEstimate := range dividendsEstimates {
... ... @@ -1059,14 +1064,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
failedReasonStr = "无"
}
elapsed := time.Since(start)
fmt.Println("该函数执行完成耗时:", elapsed)
endSave := time.Since(startSave)
log.Logger.Info("保存预算单耗时", map[string]interface{}{
"保存预算单耗时": endSave.Seconds(),
})
return map[string]interface{}{
"report": fmt.Sprintf("已完成%d单订单分红预算,生成%d单分红预算,%d笔订单分红预算失败,失败原因:%s", len(estimateSuccessfullyDividendsOrders), successfullyCount, len(estimateFailedDividendsOrders), failedReasonStr),
}, nil
... ...
... ... @@ -15,6 +15,7 @@ type LoggerConfig struct {
Level int `json:"level,omitempty"`
Filename string `json:"filename,omitempty"`
MaxSize int `json:"maxsize,omitempty"`
Maxlines int `json:"maxlines,omitempty"`
MaxBackups int `json:"max_backups,omitempty"`
MaxAge int `json:"max_age,omitempty"`
Compress bool `json:"compress,omitempty"`
... ... @@ -117,6 +118,7 @@ func NewBeegoLog(conf LoggerConfig) *BeegoLog {
logger.EnableFuncCallDepth(true)
logger.SetLogFuncCallDepth(5)
logger.SetPrefix(constant.LOG_PREFIX)
logger.Async()
return &BeegoLog{
beeLogger: logger,
}
... ...
... ... @@ -13,7 +13,8 @@ func init() {
Logger = NewBeegoLog(LoggerConfig{
Filename: constant.LOG_FILE,
Level: 7,
MaxSize: 1024 * 1024 * 6,
MaxSize: 1024 * 1024 * 2,
Maxlines: 10000000,
})
} else if constant.LOG_FRAMEWORK == "logrus" {
Logger = logrus.NewLogrusLogger()
... ...