mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-05-17 12:30:20 +00:00
* pref: 修改 activity log * perf: 优化 acitivity * pref: 修改 activity * fix: 修复一些运行问题 * fix: app.py 中添加 tasks import * fix: 添加 activity_callback * fix: 添加 execute_account_backup_plan activity_callback * fix: 添加 activity_callback -> gather_asset_accounts * fix: 对 celery 任务添加 activity_callback 回调 * fix: 修改翻译 --------- Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: jiangweidong <weidong.jiang@fit2cloud.com> Co-authored-by: Bai <baijiangjie@gmail.com>
15 lines
453 B
Python
15 lines
453 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
|
|
from celery import shared_task
|
|
from ops.celery.decorator import register_as_period_task
|
|
from django.contrib.sessions.models import Session
|
|
from django.utils import timezone
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
@shared_task(verbose_name=_('Clean expired session'))
|
|
@register_as_period_task(interval=3600 * 24)
|
|
def clean_django_sessions():
|
|
Session.objects.filter(expire_date__lt=timezone.now()).delete()
|