fix broadcast
This commit is contained in:
		
							
								
								
									
										8
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								app.py
									
									
									
									
									
								
							| @ -26,11 +26,11 @@ async def set_variable(project_id,var): | |||||||
|     if not vars.get(project_id,''): |     if not vars.get(project_id,''): | ||||||
|         vars[project_id] = {} |         vars[project_id] = {} | ||||||
|     vars[project_id][var.get('name','')] = var.get('value','') |     vars[project_id][var.get('name','')] = var.get('value','') | ||||||
|     await websockets.broadcast(clients.get(project_id,[]),json.dumps(var)) |     websockets.broadcast(clients.get(project_id,[]),json.dumps(var)) | ||||||
|  |  | ||||||
| async def disconnect(project_id,user): | async def disconnect(project_id,ws): | ||||||
|     print("disconnecting",user) |     print(f"disconnecting {ws.host}:{ws.port}") | ||||||
|     clients.get(project_id,[]).pop(user) |     clients.get(project_id,[]).remove(ws) | ||||||
|              |              | ||||||
|  |  | ||||||
| async def process(ws, path): | async def process(ws, path): | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user