Skip to content

Commit

Permalink
recalculated keys are created only for non dry run launch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-myles committed Dec 17, 2023
1 parent 52cfa61 commit 8a4790c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@ func (m *miner) mine(ctx context.Context, workerNumber int64) {

if !balanceForTMinusBugfixDryRunEnabled {
usr.BalanceForTMinus1 = recalculatedUsr.BalanceForTMinus1
}

recalculatedUsersUpdated = append(recalculatedUsersUpdated, &recalculated{
DeserializedRecalculatedUsersKey: model.DeserializedRecalculatedUsersKey{ID: usr.ID},
RecalculatedBalanceForTMinus1AtField: model.RecalculatedBalanceForTMinus1AtField{RecalculatedBalanceForTMinus1At: now},
})
recalculatedUsersUpdated = append(recalculatedUsersUpdated, &recalculated{
DeserializedRecalculatedUsersKey: model.DeserializedRecalculatedUsersKey{ID: usr.ID},
RecalculatedBalanceForTMinus1AtField: model.RecalculatedBalanceForTMinus1AtField{RecalculatedBalanceForTMinus1At: now},
})
}
}
}
}
Expand All @@ -410,7 +410,6 @@ func (m *miner) mine(ctx context.Context, workerNumber int64) {
}
}
}

balanceT2RecalculationDryRunItems = append(balanceT2RecalculationDryRunItems, &balanceT2RecalculationDryRun{
OldT2Balance: usr.BalanceT2,
NewT2Balance: balanceT2,
Expand All @@ -419,12 +418,12 @@ func (m *miner) mine(ctx context.Context, workerNumber int64) {

if !balanceT2BugfixDryRunEnabled {
usr.BalanceT2 = balanceT2
}

recalculatedUsersUpdated = append(recalculatedUsersUpdated, &recalculated{
DeserializedRecalculatedUsersKey: model.DeserializedRecalculatedUsersKey{ID: usr.ID},
RecalculatedBalanceT2AtField: model.RecalculatedBalanceT2AtField{RecalculatedBalanceT2At: now},
})
recalculatedUsersUpdated = append(recalculatedUsersUpdated, &recalculated{
DeserializedRecalculatedUsersKey: model.DeserializedRecalculatedUsersKey{ID: usr.ID},
RecalculatedBalanceT2AtField: model.RecalculatedBalanceT2AtField{RecalculatedBalanceT2At: now},
})
}
}
}

Expand Down

0 comments on commit 8a4790c

Please sign in to comment.