(account)
| 37 | |
| 38 | |
| 39 | def increment_stream_count(account): |
| 40 | with lock: |
| 41 | current_usage = active_streams_map.get(account.id, 0) |
| 42 | current_usage += 1 |
| 43 | active_streams_map[account.id] = current_usage |
| 44 | account.active_streams = current_usage |
| 45 | account.save(update_fields=['active_streams']) |
| 46 | |
| 47 | def decrement_stream_count(account): |
| 48 | with lock: |