feat(import): try to be more aggressive on cache invalidation

This commit is contained in:
Herculino Trotta
2025-01-23 21:12:13 -03:00
parent 928ad33111
commit 38379ab2b1
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import logging
import cachalot.api
from procrastinate.contrib.django import app
from apps.import_app.models import ImportRun
@@ -14,5 +15,7 @@ def process_import(import_run_id: int, file_path: str):
import_run = ImportRun.objects.get(id=import_run_id)
import_service = ImportServiceV1(import_run)
import_service.process_file(file_path)
cachalot.api.invalidate()
except ImportRun.DoesNotExist:
cachalot.api.invalidate()
raise ValueError(f"ImportRun with id {import_run_id} not found")