sub/pub to deployment channel

This commit is contained in:
rmanach 2023-09-18 15:42:23 +02:00
parent 46e1f42961
commit 89bc1ca87d
2 changed files with 7 additions and 2 deletions

View File

@ -28,5 +28,5 @@ def deploy(deployment_id: UUID):
)
deploy.save()
send_event("test", "message", {"id": deploy.id, "status": deploy.status})
send_event("deployment", "message", {"id": deploy.id, "status": deploy.status})
print("event sent")

View File

@ -8,5 +8,10 @@ urlpatterns = [
path("create", create, name="deployment-create"),
path("<uuid:deployment_id>", details, name="deployment-details"),
path("<uuid:deployment_id>/deploy", deploy, name="deployment-launch"),
path("events/", include(django_eventstream.urls), {"channels": ["test"]}),
path(
"events/",
include(django_eventstream.urls),
{"channels": ["deployment"]},
name="deployment-events",
),
]