mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 01:28:42 +02:00
feat(import): try to be more aggressive on cache invalidation
This commit is contained in:
@@ -542,6 +542,4 @@ class ImportService:
|
|||||||
|
|
||||||
self.import_run.finished_at = timezone.now()
|
self.import_run.finished_at = timezone.now()
|
||||||
self.import_run.save(update_fields=["finished_at"])
|
self.import_run.save(update_fields=["finished_at"])
|
||||||
|
cachalot.api.invalidate()
|
||||||
if self.import_run.successful_rows >= 1:
|
|
||||||
cachalot.api.invalidate()
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import cachalot.api
|
||||||
from procrastinate.contrib.django import app
|
from procrastinate.contrib.django import app
|
||||||
|
|
||||||
from apps.import_app.models import ImportRun
|
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_run = ImportRun.objects.get(id=import_run_id)
|
||||||
import_service = ImportServiceV1(import_run)
|
import_service = ImportServiceV1(import_run)
|
||||||
import_service.process_file(file_path)
|
import_service.process_file(file_path)
|
||||||
|
cachalot.api.invalidate()
|
||||||
except ImportRun.DoesNotExist:
|
except ImportRun.DoesNotExist:
|
||||||
|
cachalot.api.invalidate()
|
||||||
raise ValueError(f"ImportRun with id {import_run_id} not found")
|
raise ValueError(f"ImportRun with id {import_run_id} not found")
|
||||||
|
|||||||
Reference in New Issue
Block a user