Fix user metric update batch ordering
This commit is contained in:
parent
d67220aa5e
commit
d7f507916f
@ -191,6 +191,20 @@ func (r *MySQLRepository) ApplyContributionBatch(ctx context.Context, tx *sql.Tx
|
||||
}
|
||||
}
|
||||
|
||||
for _, c := range negative {
|
||||
if err := r.ApplyDailyContribution(ctx, tx, c, storageTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, statTimezone := range statTimezones {
|
||||
if err := r.ApplyPeriodContribution(ctx, tx, c, statTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := r.ApplyGamePeriodContribution(ctx, tx, c, statTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for key, totals := range dailyAmounts {
|
||||
if totals.empty() {
|
||||
continue
|
||||
@ -230,19 +244,6 @@ func (r *MySQLRepository) ApplyContributionBatch(ctx context.Context, tx *sql.Tx
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range negative {
|
||||
if err := r.ApplyDailyContribution(ctx, tx, c, storageTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, statTimezone := range statTimezones {
|
||||
if err := r.ApplyPeriodContribution(ctx, tx, c, statTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := r.ApplyGamePeriodContribution(ctx, tx, c, statTimezone); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user