diff --git a/engine/storage_redis.go b/engine/storage_redis.go index eda468131..2cddfa257 100644 --- a/engine/storage_redis.go +++ b/engine/storage_redis.go @@ -79,7 +79,7 @@ func (rs *RedisStorage) Close() { } func (rs *RedisStorage) Flush(ignore string) error { - return rs.db.Cmd("FLUSH").Err + return rs.db.Cmd("FLUSHDB").Err } func (rs *RedisStorage) GetKeysForPrefix(prefix string) ([]string, error) { @@ -620,18 +620,6 @@ func (rs *RedisStorage) GetAccount(key string) (ub *Account, err error) { } func (rs *RedisStorage) SetAccount(ub *Account) (err error) { - // never override existing account with an empty one - // UPDATE: if all balances expired and were cleaned it makes - // sense to write empty balance map - if len(ub.BalanceMap) == 0 { - if ac, err := rs.GetAccount(ub.Id); err == nil && !ac.allBalancesExpired() { - ac.ActionTriggers = ub.ActionTriggers - ac.UnitCounters = ub.UnitCounters - ac.AllowNegative = ub.AllowNegative - ac.Disabled = ub.Disabled - ub = ac - } - } result, err := rs.ms.Marshal(ub) err = rs.db.Cmd("SET", utils.ACCOUNT_PREFIX+ub.Id, result).Err return