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()