]> git.parisson.com Git - teleforma.git/commitdiff
use async client, upgrade drf, change api urls feature/async-notif
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 9 Feb 2026 20:53:48 +0000 (21:53 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 9 Feb 2026 20:53:48 +0000 (21:53 +0100)
app/asgi.sh
poetry.lock
pyproject.toml
teleforma/models/core.py
teleforma/urls.py

index 12705d9b440895b011e4ef9447de635f638c0b2b..da28f0454e6538ecc976763d09cc6836d2578c0a 100755 (executable)
@@ -14,5 +14,5 @@ if [ "$1" = "--runserver" ]; then
     python $manage runserver 0.0.0.0:8000
 else
     rm $sock
-    uvicorn asgi:application --uds $sock --log-level $loglevel --workers $workers --ws websockets
+    uvicorn asgi:application --uds $sock --log-level $loglevel --workers $workers --ws websockets --reload
 fi
index 83e046d6551309371074f057f4a69b11b4b69138..97f5a51f1310f304c244db65ce947d1dfa179a56 100644 (file)
@@ -864,17 +864,17 @@ user-agents = "*"
 
 [[package]]
 name = "djangorestframework"
-version = "3.13.1"
+version = "3.14.0"
 description = "Web APIs for Django, made easy."
 optional = false
 python-versions = ">=3.6"
 files = [
-    {file = "djangorestframework-3.13.1-py3-none-any.whl", hash = "sha256:24c4bf58ed7e85d1fe4ba250ab2da926d263cd57d64b03e8dcef0ac683f8b1aa"},
-    {file = "djangorestframework-3.13.1.tar.gz", hash = "sha256:0c33407ce23acc68eca2a6e46424b008c9c02eceb8cf18581921d0092bc1f2ee"},
+    {file = "djangorestframework-3.14.0-py3-none-any.whl", hash = "sha256:eb63f58c9f218e1a7d064d17a70751f528ed4e1d35547fdade9aaf4cd103fd08"},
+    {file = "djangorestframework-3.14.0.tar.gz", hash = "sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8"},
 ]
 
 [package.dependencies]
-django = ">=2.2"
+django = ">=3.0"
 pytz = "*"
 
 [[package]]
@@ -2678,4 +2678,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"]
 [metadata]
 lock-version = "2.0"
 python-versions = "^3.10"
-content-hash = "c30d4c3ca51024171a0afd7949e46cb6d7fe355554c68606fce5681e027a16ef"
+content-hash = "4062afc0dfb832228eb01c654c916e75a7bc19351d231f6a3e5ab87ccd2eea31"
index 3200bea4e9997dc997de0f3452c2abc50fd77e8d..e93092a40c293b92bab9e72e8c728fa4eaa4191d 100644 (file)
@@ -13,7 +13,7 @@ channels = "3.0.4"
 channels-redis = "3.4.0"
 docutils = "0.17.1"
 django = "3.2.25"
-djangorestframework = "3.13.1"
+djangorestframework = "3.14.0"
 django-debug-toolbar = "3.2.1"
 dj-pagination = "2.5.0"
 django-jazzmin = "2.4.7"
index 0c1f61ece48790b5af2aa8615ce2a8520d1c7bf9..d4b081ab4f2ecfefc1f779b20198b0fe09e2ef86 100644 (file)
@@ -495,7 +495,7 @@ class Conference(models.Model):
             if settings.DEBUG:
                 requests.post(f"{settings.CHANNEL_URL}{reverse('teleforma-live-conference-notify')}", {'id': self.id})
             else:
-                transport = httpx.HTTPTransport(uds=settings.CHANNEL_URL)
+                transport = httpx.AsyncHTTPTransport(uds=settings.CHANNEL_URL)
                 async with httpx.AsyncClient(transport=transport) as client:
                     response = await client.post("http://channels" + reverse('teleforma-live-conference-notify-async'),
                                             data={'id': self.id}, timeout=20.0)
@@ -511,9 +511,9 @@ class Conference(models.Model):
             else:
                 transport = httpx.HTTPTransport(uds=settings.CHANNEL_URL)
                 with httpx.Client(transport=transport) as client:
-                    response = client.post("http://localhost" + reverse('teleforma-live-conference-notify'),
+                    response = client.post("http://channels" + reverse('teleforma-live-conference-notify-async'),
                                             data={'id': self.id}, timeout=120.0)
-                    assert response.status_code == 200
+                    #assert response.status_code == 200
             self.notified_live = True
             self.save()
 
index 2080b8d37afcc32f0ebbca50e521be9f74cf4c57..e433d7f9388c4712004da42087eecebfc08f3cd1 100644 (file)
@@ -286,11 +286,11 @@ urlpatterns = [
         NotificationView.as_view(), name='teleforma-notification'),
 
     # must be called on channels instance
-    path('live_conference_notify',
+    path(r'api/live_conference_notify',
         LiveConferenceNotify.as_view(), name='teleforma-live-conference-notify'),
 
     # must be called on channels instance
-    path('live_conference_notify_async',
+    path(r'api/live_conference_notify_async',
         LiveConferenceNotifyAsync.as_view(), name='teleforma-live-conference-notify-async'),
 
     # QUIZ