From 21a7ec9feca5bef8df5008c5c81196868a529dde Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 19 Aug 2021 15:40:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=87=E7=BA=A7=E6=97=B6=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/management/commands/expire_caches.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/common/management/commands/expire_caches.py b/apps/common/management/commands/expire_caches.py index fb09f47eb..37fe7605b 100644 --- a/apps/common/management/commands/expire_caches.py +++ b/apps/common/management/commands/expire_caches.py @@ -1,6 +1,7 @@ from django.core.management.base import BaseCommand from assets.signals_handler.node_assets_mapping import expire_node_assets_mapping_for_memory +from orgs.caches import OrgResourceStatisticsCache from orgs.models import Organization @@ -12,8 +13,16 @@ def expire_node_assets_mapping(): expire_node_assets_mapping_for_memory(org_id) +def expire_org_resource_statistics_cache(): + orgs = Organization.objects.all() + for org in orgs: + cache = OrgResourceStatisticsCache(org) + cache.expire() + + class Command(BaseCommand): help = 'Expire caches' def handle(self, *args, **options): expire_node_assets_mapping() + expire_org_resource_statistics_cache()