Skip to content

Commit

Permalink
Update tests and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tijani-Dia committed Oct 23, 2021
1 parent b0d0d28 commit 25938cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/wagtail_live/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ def ready(self):
if issubclass(live_publisher, BaseWebsocketPublisher):
from wagtail_live.signals import live_page_update

live_page_update.connect(live_publisher(), weak=False, dispatch_uid="live_publisher")
# Set`weak=False` to avoid the publisher being garbage collected.
# See:
# https://docs.djangoproject.com/en/3.2/topics/signals/#django.dispatch.Signal.connect
live_page_update.connect(
live_publisher(), weak=False, dispatch_uid="live_publisher"
)
3 changes: 2 additions & 1 deletion tests/testapp/publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@


class DummyWebsocketPublisher(BaseWebsocketPublisher):
pass
def publish(self, channel_id, renders, removals):
pass


class DummyPublisher:
Expand Down

0 comments on commit 25938cc

Please sign in to comment.