Esempio n. 1
0
	def handle(self, *args, **options):
		from chat.global_redis import sync_redis
		webrtc_connections = sync_redis.hgetall(RedisPrefix.WEBRTC_CONNECTION)
		if webrtc_connections:
			sync_redis.delete(*webrtc_connections.keys())
			sync_redis.delete(RedisPrefix.WEBRTC_CONNECTION)
			print('Flushed webrtc connections: {}'.format(webrtc_connections))
		else:
			print("There're no connections to flush in '{}' redis key, skipping...".format(RedisPrefix.WEBRTC_CONNECTION))
Esempio n. 2
0
	def handle(self, *args, **options):
		from chat.global_redis import sync_redis
		rooms = Room.objects.values('id')
		rooms_id = [room['id'] for room in rooms]
		if len(rooms_id) > 0:
			sync_redis.delete(*rooms_id)
			print('Flushed room keys: {}'.format(rooms_id))
		else:
			raise Exception('No rooms found, expected at least one global room. Did you forget to run "python manage.py init_db" command?')
Esempio n. 3
0
 def handle(self, *args, **options):
     from chat.global_redis import sync_redis
     sync_redis.delete(RedisPrefix.ONLINE_VAR)
Esempio n. 4
0
 def handle(self, *args, **options):
     from chat.global_redis import sync_redis
     rooms = Room.objects.values('id')
     for room in rooms:
         sync_redis.delete(room['id'])
     print('Flushed room keys: {}'.format(rooms))