mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
fix(i18n): use English runtime text and localize system UI
This commit is contained in:
@@ -23,8 +23,8 @@ const (
|
||||
var RebuildUploadStatsMeta = task.TaskMeta{
|
||||
Type: TaskTypeRebuildUploadStats,
|
||||
AsynqTask: RebuildUploadStatsTask,
|
||||
Name: "重算文件存储统计",
|
||||
Description: "根据当前 w_uploads 活跃记录全量重建 w_upload_stats(总量、类型、分类、趋势)",
|
||||
Name: "Rebuild file storage statistics",
|
||||
Description: "Rebuild w_upload_stats from active w_uploads records, including totals, types, categories and trends",
|
||||
SupportsTime: false,
|
||||
MaxRetry: task.DefaultMaxRetry,
|
||||
Queue: task.QueueDefault,
|
||||
@@ -38,25 +38,25 @@ type RebuildUploadStatsHandler struct{}
|
||||
func (h *RebuildUploadStatsHandler) Execute(ctx context.Context, _ []byte) (*task.TaskResult, error) {
|
||||
activeCount, err := repository.CountActiveUploads(ctx)
|
||||
if err != nil {
|
||||
task.AppendLog(ctx, "统计活跃上传记录失败: %v", err)
|
||||
task.AppendLog(ctx, "Failed to count active uploads: %v", err)
|
||||
return nil, fmt.Errorf("count active uploads: %w", err)
|
||||
}
|
||||
|
||||
task.AppendLog(ctx, "开始重算文件存储统计,活跃记录数: %d", activeCount)
|
||||
task.AppendLog(ctx, "Rebuilding file storage statistics; active records: %d", activeCount)
|
||||
|
||||
if err := uploadstats.RebuildUploadStats(ctx); err != nil {
|
||||
task.AppendLog(ctx, "重算文件存储统计失败: %v", err)
|
||||
task.AppendLog(ctx, "Failed to rebuild file storage statistics: %v", err)
|
||||
return nil, fmt.Errorf("rebuild upload stats: %w", err)
|
||||
}
|
||||
|
||||
totalStat, err := repository.GetTotalUploadStat(ctx)
|
||||
if err != nil {
|
||||
task.AppendLog(ctx, "读取总量统计失败: %v", err)
|
||||
task.AppendLog(ctx, "Failed to read aggregate statistics: %v", err)
|
||||
return nil, fmt.Errorf("load total upload stats: %w", err)
|
||||
}
|
||||
|
||||
msg := fmt.Sprintf(
|
||||
"文件存储统计重算完成,活跃记录 %d 条,统计文件数 %d,总大小 %d 字节",
|
||||
"File storage statistics rebuilt: %d active records, %d files, %d bytes total",
|
||||
activeCount,
|
||||
totalStat.FileCount,
|
||||
totalStat.FileSize,
|
||||
|
||||
Reference in New Issue
Block a user