Exemplo n.º 1
0
    def ready(self):
        """Configure kuma.core after models are loaded."""

        # Clean up expired sessions every 60 minutes
        from kuma.core.tasks import clean_sessions

        app.add_periodic_task(60 * 60, clean_sessions.s())
Exemplo n.º 2
0
    def ready(self):
        """Configure kuma.feeder after models are loaded."""

        # Refresh Hacks Blog: every 10 minutes
        from kuma.feeder.tasks import update_feeds

        app.add_periodic_task(60 * 10, update_feeds.s())
Exemplo n.º 3
0
    def ready(self):
        """Configure kuma.wiki after models are loaded."""
        # Register signal handlers
        from . import signal_handlers  # noqa

        # Render stale documents: every 60 minutes
        from kuma.wiki.tasks import render_stale_documents

        app.add_periodic_task(60 * 60, render_stale_documents.s())
Exemplo n.º 4
0
    def ready(self):
        """Configure kuma.wiki after models are loaded."""
        # Register signal handlers
        from . import signal_handlers  # noqa

        # Build sitemaps every day at 05:00
        from kuma.wiki.tasks import build_sitemaps
        app.add_periodic_task(
            crontab(minute=0, hour=5),
            build_sitemaps.s(),
        )

        # Render stale documents: every 60 minutes
        from kuma.wiki.tasks import render_stale_documents
        app.add_periodic_task(60 * 60, render_stale_documents.s())
Exemplo n.º 5
0
    def add_periodc_tasks(self):
        # Clean up expired sessions every 60 minutes
        from kuma.core.tasks import clean_sessions

        app.add_periodic_task(60 * 60, clean_sessions.s())
Exemplo n.º 6
0
    def ready(self):
        """Configure kuma.humans after models are loaded."""

        # Refresh humans.txt every day at 00:00
        from kuma.humans.tasks import humans_txt
        app.add_periodic_task(crontab(minute=0, hour=0), humans_txt.s())