watchnodocks

This commit is contained in:
Nukeap committed 2025-02-09 17:28:35 +03:00
1 parent 2c6e15e480
commit 2d971c4af4
140 files changed
+908 -865

No files matched your search

+9 -2
View File
@@ -7,15 +7,22 @@ import jwt
import redis
class WatcherConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.client = redis.Redis(host='127.0.0.1')
async def connect(self):
print("Sdsdsdds")
self.client = redis.Redis(host='redis')
user = parse_qs(self.scope["query_string"].decode("utf8"))["token"][0]
user = jwt.decode(user, options={"verify_signature": False})
# self.client.sadd('online',json.dumps(user['user'],indent=4))
self.room_group_name = "online"
self.client.hset('online',str(self.channel_name), user['user']['login'] )
# Join room group
await self.channel_layer.group_add(
self.room_group_name, self.channel_name
)