Merge pull request #799 from maxthomas/fix-openapi-comment
[mygpo.git] / mygpo / data / apps.py
blobe4943fba8d9cfdf0329e353825af03c3bda8ce76
1 from django.apps import AppConfig
2 from mygpo.pubsub.signals import subscription_updated
4 import logging
6 logger = logging.getLogger(__name__)
9 def update_podcast(sender, **kwargs):
10 """update podcast in background when receiving pubsub-notification"""
11 from mygpo.data.tasks import update_podcasts
13 logger.info('updating podcast for "%s" after pubsub notification', sender)
14 update_podcasts.delay([sender])
17 class DataAppConfig(AppConfig):
18 name = "mygpo.data"
20 def ready(self):
21 subscription_updated.connect(
22 update_podcast, dispatch_uid="update_podcast-pubsub"