Commit 8c85a75894e8ab32f2401aa218fa3b54ff07a765
1 parent
4f2eb19346
Exists in
master
bugfix set expire on redis balance
Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff
main.py
... | ... | @@ -348,9 +348,8 @@ def saveBalanceToRedis(balance): |
348 | 348 | try: |
349 | 349 | redis_pipe.mset(data) |
350 | 350 | |
351 | - redis_key = ['balance.gw:' + BASE_CHIPINFO, 'balance.gw:' + CHIPINFO, 'balance.gw:' + MSISDN] | |
352 | - for k in redis_key: | |
353 | - redis_pipe.expire(redis_key, 3600 * 24 * 60) | |
351 | + for k in data: | |
352 | + redis_pipe.expire(k, 3600 * 24 * 60) | |
354 | 353 | |
355 | 354 | except: |
356 | 355 | logger.warning('Failed to save balance to redis') |