mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
feat: rename app, some work on schema
This commit is contained in:
18
app/apps/import_app/tasks.py
Normal file
18
app/apps/import_app/tasks.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import logging
|
||||
|
||||
from procrastinate.contrib.django import app
|
||||
|
||||
from apps.import_app.models import ImportRun
|
||||
from apps.import_app.services import ImportServiceV1
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@app.task(queue="imports")
|
||||
def process_import(import_run_id: int, file_path: str):
|
||||
try:
|
||||
import_run = ImportRun.objects.get(id=import_run_id)
|
||||
import_service = ImportServiceV1(import_run)
|
||||
import_service.process_file(file_path)
|
||||
except ImportRun.DoesNotExist:
|
||||
raise ValueError(f"ImportRun with id {import_run_id} not found")
|
||||
Reference in New Issue
Block a user