Add organizations v2 API and registry enrichment
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 26s
CI/CD Pipeline / Build and Push Images (push) Successful in 6s
CI/CD Pipeline / Internal Notify (push) Successful in 0s
CI/CD Pipeline / Deploy Dev in Dokploy (push) Successful in 1s

This commit is contained in:
2026-05-06 19:04:46 +02:00
parent f54aa4cb0b
commit 0f17ff6773
62 changed files with 10311 additions and 430 deletions

View File

@@ -0,0 +1,37 @@
"""Celery tasks for organizations snapshots."""
from __future__ import annotations
import logging
from celery import shared_task
from django.core.cache import cache
from organizations.services import OrganizationDataSnapshotRefreshService
logger = logging.getLogger(__name__)
@shared_task
def refresh_organization_data_snapshots_for_parser_batch(
*,
source: str,
batch_id: int,
batch_size: int = 100,
) -> dict:
"""Refresh snapshots for organizations affected by one parser batch."""
result = OrganizationDataSnapshotRefreshService.refresh_for_parser_batch(
source=source,
batch_id=batch_id,
batch_size=batch_size,
)
cache.clear()
payload = {
"source": source,
"batch_id": batch_id,
"processed": result.processed,
"created": result.created,
"updated": result.updated,
}
logger.info("Organization data snapshots refreshed: %s", payload)
return payload