org.cronjobs ============ .. py:module:: org.cronjobs Attributes ---------- .. autoapisummary:: org.cronjobs.log org.cronjobs.MON org.cronjobs.TUE org.cronjobs.WED org.cronjobs.THU org.cronjobs.FRI org.cronjobs.SAT org.cronjobs.SUN org.cronjobs.WEEKDAYS Functions --------- .. autoapisummary:: org.cronjobs.hourly_maintenance_tasks org.cronjobs.send_scheduled_newsletter org.cronjobs.publish_files org.cronjobs.handle_publication_models org.cronjobs.delete_old_tans org.cronjobs.delete_old_tan_accesses org.cronjobs.process_resource_rules org.cronjobs.ticket_statistics_common_template_args org.cronjobs.ticket_statistics_users org.cronjobs.send_daily_ticket_statistics org.cronjobs.send_weekly_ticket_statistics org.cronjobs.send_monthly_ticket_statistics org.cronjobs.send_daily_resource_usage_overview org.cronjobs.end_chats_and_create_tickets org.cronjobs.archive_old_tickets org.cronjobs.delete_old_tickets org.cronjobs.send_monthly_mtan_statistics org.cronjobs.delete_content_marked_deletable org.cronjobs.update_newsletter_email_bounce_statistics org.cronjobs.delete_unconfirmed_newsletter_subscriptions org.cronjobs.get_news_for_push_notification org.cronjobs.send_push_notifications_for_news org.cronjobs.normalize_adjacency_list_order Module Contents --------------- .. py:data:: log .. py:data:: MON :value: 0 .. py:data:: TUE :value: 1 .. py:data:: WED :value: 2 .. py:data:: THU :value: 3 .. py:data:: FRI :value: 4 .. py:data:: SAT :value: 5 .. py:data:: SUN :value: 6 .. py:data:: WEEKDAYS :value: ('MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU') .. py:function:: hourly_maintenance_tasks(request: onegov.org.request.OrgRequest) -> None .. py:function:: send_scheduled_newsletter(request: onegov.org.request.OrgRequest) -> None .. py:function:: publish_files(request: onegov.org.request.OrgRequest) -> None .. py:function:: handle_publication_models(request: onegov.org.request.OrgRequest) -> None Reindexes all recently published/unpublished objects in the elasticsearch database. For pages it also updates the propagated access to any associated files. For directory entries it also sends out e-mail notifications if published within the last hour. .. py:function:: delete_old_tans(request: onegov.org.request.OrgRequest) -> None Deletes TANs that are older than half a year. Technically we could delete them as soon as they expire but for debugging purposes it makes sense to keep them around a while longer. .. py:function:: delete_old_tan_accesses(request: onegov.org.request.OrgRequest) -> None Deletes TAN accesses that are older than half a year. Technically we could delete them as soon as they expire but for debugging purposes it makes sense to keep them around a while longer. .. py:function:: process_resource_rules(request: onegov.org.request.OrgRequest) -> None .. py:function:: ticket_statistics_common_template_args(request: onegov.org.request.OrgRequest, collection: onegov.ticket.TicketCollection) -> dict[str, Any] .. py:function:: ticket_statistics_users(app: onegov.org.OrgApp) -> list[onegov.user.User] .. py:function:: send_daily_ticket_statistics(request: onegov.org.request.OrgRequest) -> None .. py:function:: send_weekly_ticket_statistics(request: onegov.org.request.OrgRequest) -> None .. py:function:: send_monthly_ticket_statistics(request: onegov.org.request.OrgRequest) -> None .. py:function:: send_daily_resource_usage_overview(request: onegov.org.request.OrgRequest) -> None .. py:function:: end_chats_and_create_tickets(request: onegov.org.request.OrgRequest) -> None .. py:function:: archive_old_tickets(request: onegov.org.request.OrgRequest) -> None .. py:function:: delete_old_tickets(request: onegov.org.request.OrgRequest) -> None .. py:function:: send_monthly_mtan_statistics(request: onegov.org.request.OrgRequest) -> None .. py:function:: delete_content_marked_deletable(request: onegov.org.request.OrgRequest) -> None Find all models inheriting from DeletableContentExtension, iterate over objects marked as `deletable` and delete them if expired. Currently extended directory entries, news, events and occurrences. .. py:function:: update_newsletter_email_bounce_statistics(request: onegov.org.request.OrgRequest) -> None .. py:function:: delete_unconfirmed_newsletter_subscriptions(request: onegov.org.request.OrgRequest) -> None Delete unconfirmed newsletter subscriptions older than 7 days. .. py:function:: get_news_for_push_notification(session: sqlalchemy.orm.Session) -> sqlalchemy.orm.Query[onegov.org.models.News] .. py:function:: send_push_notifications_for_news(request: onegov.org.request.OrgRequest) -> None Cronjob that runs every 10 minutes to send push notifications for news. It collects all news items with: - Publication start date within the last 10 minutes - send_push_notifications_to_app flag enabled - Defined push_notifications topics Then uses Firebase to send notifications to the corresponding topics. .. py:function:: normalize_adjacency_list_order(request: onegov.org.request.OrgRequest) -> None Normalizes the 'order' column for all AdjacencyList subclasses. The midpoint insertion strategy for 'order' (Decimal) can lead to precision issues or very close values over time. This cronjob renumbers the 'order' for each group of siblings (same parent_id) sequentially starting from 1, effectively resetting the order values while preserving the relative order within each sibling group.