Ekimart commited on
Commit
f2a407c
·
1 Parent(s): 7ef23aa

Supprimer les fichiers de configuration de l'IDE et mettre à jour la gestion des timestamps dans WebSocketManager

Browse files
.gitignore CHANGED
@@ -1,2 +1,4 @@
1
  .venv
2
- __pycache__/
 
 
 
1
  .venv
2
+ __pycache__/
3
+ .idea
4
+ .vscode
.idea/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
 
 
 
 
 
 
 
 
 
.idea/NotificationChannel.iml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.idea/dictionaries" />
6
- <excludeFolder url="file://$MODULE_DIR$/.idea/inspectionProfiles" />
7
- <excludeFolder url="file://$MODULE_DIR$/.venv" />
8
- </content>
9
- <orderEntry type="jdk" jdkName="Python 3.13 (NotificationChannel)" jdkType="Python SDK" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- <component name="PackageRequirementsSettings">
13
- <option name="versionSpecifier" value="Don't specify version" />
14
- <option name="removeUnused" value="true" />
15
- <option name="modifyBaseFiles" value="true" />
16
- </component>
17
- </module>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.idea/dictionaries/project.xml DELETED
@@ -1,8 +0,0 @@
1
- <component name="ProjectDictionaryState">
2
- <dictionary name="project">
3
- <words>
4
- <w>buzup</w>
5
- <w>levelname</w>
6
- </words>
7
- </dictionary>
8
- </component>
 
 
 
 
 
 
 
 
 
.idea/inspectionProfiles/Project_Default.xml DELETED
@@ -1,18 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
5
- <Languages>
6
- <language minSize="70" name="Python" />
7
- </Languages>
8
- </inspection_tool>
9
- <inspection_tool class="IncorrectHttpHeaderInspection" enabled="true" level="WARNING" enabled_by_default="true">
10
- <option name="customHeaders">
11
- <set>
12
- <option value="X-Engine-Key" />
13
- <option value="X-Engine-QA-Key" />
14
- </set>
15
- </option>
16
- </inspection_tool>
17
- </profile>
18
- </component>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.idea/inspectionProfiles/profiles_settings.xml DELETED
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
 
 
 
 
 
 
 
.idea/misc.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Black">
4
- <option name="enabledOnReformat" value="true" />
5
- <option name="enabledOnSave" value="true" />
6
- <option name="sdkName" value="Python 3.13 (NotificationChannel)" />
7
- </component>
8
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (NotificationChannel)" project-jdk-type="Python SDK" />
9
- </project>
 
 
 
 
 
 
 
 
 
 
.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/NotificationChannel.iml" filepath="$PROJECT_DIR$/.idea/NotificationChannel.iml" />
6
- </modules>
7
- </component>
8
- </project>
 
 
 
 
 
 
 
 
 
.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
 
 
 
 
 
 
 
core/manager/websocket_manager.py CHANGED
@@ -1,11 +1,11 @@
1
  from collections import deque
2
- from datetime import datetime
3
  from typing import Dict, List, Any, Deque
4
 
5
  from fastapi import WebSocket
6
 
7
  from core.settings.settings import Settings
8
  from core.types.datamodels import ClientInfo, Subscription, Notification
 
9
 
10
 
11
  class WebSocketManager:
@@ -37,7 +37,7 @@ class WebSocketManager:
37
  "type": "connection_established",
38
  "session_id": session_id,
39
  "message": "Connexion au service de notifications établie",
40
- "timestamp": datetime.utcnow().isoformat(),
41
  },
42
  )
43
 
@@ -149,7 +149,7 @@ class WebSocketManager:
149
  "active_connections": len(self.active_connections),
150
  "total_subscriptions": sum(len(s) for s in self.subscriptions.values()),
151
  "total_notifications": len(self.notification_history),
152
- "timestamp": datetime.utcnow().isoformat(),
153
  }
154
 
155
  # Méthodes internes
 
1
  from collections import deque
 
2
  from typing import Dict, List, Any, Deque
3
 
4
  from fastapi import WebSocket
5
 
6
  from core.settings.settings import Settings
7
  from core.types.datamodels import ClientInfo, Subscription, Notification
8
+ from core.utils.utils import current_utc_iso
9
 
10
 
11
  class WebSocketManager:
 
37
  "type": "connection_established",
38
  "session_id": session_id,
39
  "message": "Connexion au service de notifications établie",
40
+ "timestamp": current_utc_iso(),
41
  },
42
  )
43
 
 
149
  "active_connections": len(self.active_connections),
150
  "total_subscriptions": sum(len(s) for s in self.subscriptions.values()),
151
  "total_notifications": len(self.notification_history),
152
+ "timestamp": current_utc_iso(),
153
  }
154
 
155
  # Méthodes internes
main.py CHANGED
@@ -1,7 +1,6 @@
1
  from contextlib import asynccontextmanager
2
- from datetime import datetime
3
  from pathlib import Path
4
- from typing import Optional
5
  from uuid import uuid4
6
 
7
  import uvicorn
@@ -13,7 +12,6 @@ from fastapi import (
13
  HTTPException,
14
  Depends,
15
  )
16
- from fastapi.responses import HTMLResponse
17
  from fastapi.templating import Jinja2Templates
18
 
19
  from core.manager.websocket_manager import WebSocketManager
@@ -224,7 +222,7 @@ async def get_service_stats():
224
  @app.get("/clients")
225
  async def get_connected_clients():
226
  """Récupère la liste des clients connectés"""
227
- clients = [
228
  {
229
  "session_id": session_id,
230
  "user_id": info.user_id,
 
1
  from contextlib import asynccontextmanager
 
2
  from pathlib import Path
3
+ from typing import Any, Dict, List, Optional
4
  from uuid import uuid4
5
 
6
  import uvicorn
 
12
  HTTPException,
13
  Depends,
14
  )
 
15
  from fastapi.templating import Jinja2Templates
16
 
17
  from core.manager.websocket_manager import WebSocketManager
 
222
  @app.get("/clients")
223
  async def get_connected_clients():
224
  """Récupère la liste des clients connectés"""
225
+ clients: List[Dict[str, Any]] = [
226
  {
227
  "session_id": session_id,
228
  "user_id": info.user_id,