mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🐛 erasing users should set save flag
This commit is contained in:
parent
b66f2dc562
commit
e610615e5f
1 changed files with 8 additions and 1 deletions
|
|
@ -203,13 +203,20 @@ BankResponse Bank::PruneUsers(time_t threshold_time, uint32_t threshold_bal) noe
|
||||||
size_t deleted_count = 0;
|
size_t deleted_count = 0;
|
||||||
for (const auto &u : users)
|
for (const auto &u : users)
|
||||||
{
|
{
|
||||||
users.erase_if(u.first, [threshold_time, threshold_bal, &deleted_count](User &u) -> bool {
|
users.erase_if(u.first, [this, threshold_time, threshold_bal, &deleted_count](User &u) -> bool {
|
||||||
#if MAX_LOG_SIZE > 0
|
#if MAX_LOG_SIZE > 0
|
||||||
if (u.log.data.back().time < threshold_time && u.balance < threshold_bal)
|
if (u.log.data.back().time < threshold_time && u.balance < threshold_bal)
|
||||||
#else
|
#else
|
||||||
if (u.balance < threshold_bal)
|
if (u.balance < threshold_bal)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#if CONSERVATIVE_DISK_SAVE
|
||||||
|
#if MULTI_THREADED
|
||||||
|
save_flag.SetChangesOn();
|
||||||
|
#else
|
||||||
|
save_flag = true;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
return ++deleted_count;
|
return ++deleted_count;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue