1 from django
.apps
import AppConfig
2 from mygpo
.pubsub
.signals
import subscription_updated
5 logger
= logging
.getLogger(__name__
)
8 def update_podcast(sender
, **kwargs
):
9 """ update podcast in background when receiving pubsub-notification """
10 from mygpo
.data
.tasks
import update_podcasts
11 logger
.info('updating podcast for "%s" after pubsub notification', sender
)
12 update_podcasts
.delay([sender
])
15 class DataAppConfig(AppConfig
):
19 subscription_updated
.connect(update_podcast
,
20 dispatch_uid
='update_podcast-pubsub')