(account)
| 24 | return value |
| 25 | |
| 26 | def increment_stream_count(account): |
| 27 | with lock: |
| 28 | current_usage = active_streams_map.get(account.id, 0) |
| 29 | current_usage += 1 |
| 30 | active_streams_map[account.id] = current_usage |
| 31 | account.active_streams = current_usage |
| 32 | account.save(update_fields=['active_streams']) |
| 33 | |
| 34 | def decrement_stream_count(account): |
| 35 | with lock: |