|
@@ -170,8 +170,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
|
|
|
task.Quota = actualQuota // 更新任务记录的实际扣费额度
|
|
task.Quota = actualQuota // 更新任务记录的实际扣费额度
|
|
|
|
|
|
|
|
// 记录消费日志
|
|
// 记录消费日志
|
|
|
- logContent := fmt.Sprintf("视频任务成功补扣费,模型倍率 %.2f,分组倍率 %.2f,tokens %d",
|
|
|
|
|
- modelRatio, finalGroupRatio, taskResult.TotalTokens)
|
|
|
|
|
|
|
+ logContent := fmt.Sprintf("视频任务成功补扣费,模型倍率 %.2f,分组倍率 %.2f,tokens %d,预扣费 %s,实际扣费 %s,补扣费 %s",
|
|
|
|
|
+ modelRatio, finalGroupRatio, taskResult.TotalTokens,
|
|
|
|
|
+ logger.LogQuota(preConsumedQuota), logger.LogQuota(actualQuota), logger.LogQuota(quotaDelta))
|
|
|
model.RecordLog(task.UserId, model.LogTypeSystem, logContent)
|
|
model.RecordLog(task.UserId, model.LogTypeSystem, logContent)
|
|
|
}
|
|
}
|
|
|
} else if quotaDelta < 0 {
|
|
} else if quotaDelta < 0 {
|
|
@@ -190,8 +191,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
|
|
|
task.Quota = actualQuota // 更新任务记录的实际扣费额度
|
|
task.Quota = actualQuota // 更新任务记录的实际扣费额度
|
|
|
|
|
|
|
|
// 记录退款日志
|
|
// 记录退款日志
|
|
|
- logContent := fmt.Sprintf("视频任务成功退还多扣费用,模型倍率 %.2f,分组倍率 %.2f,tokens %d,退还 %s",
|
|
|
|
|
- modelRatio, finalGroupRatio, taskResult.TotalTokens, logger.LogQuota(refundQuota))
|
|
|
|
|
|
|
+ logContent := fmt.Sprintf("视频任务成功退还多扣费用,模型倍率 %.2f,分组倍率 %.2f,tokens %d,预扣费 %s,实际扣费 %s,退还 %s",
|
|
|
|
|
+ modelRatio, finalGroupRatio, taskResult.TotalTokens,
|
|
|
|
|
+ logger.LogQuota(preConsumedQuota), logger.LogQuota(actualQuota), logger.LogQuota(refundQuota))
|
|
|
model.RecordLog(task.UserId, model.LogTypeSystem, logContent)
|
|
model.RecordLog(task.UserId, model.LogTypeSystem, logContent)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|