Schedule organization snapshot refresh
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 22s
CI/CD Pipeline / Build and Push Images (push) Successful in 5s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev in Dokploy (push) Successful in 1s

This commit is contained in:
2026-05-06 20:54:13 +02:00
parent 0f17ff6773
commit 507ae2063a
3 changed files with 140 additions and 0 deletions

View File

@@ -12,6 +12,20 @@ from organizations.services import OrganizationDataSnapshotRefreshService
logger = logging.getLogger(__name__)
@shared_task
def refresh_all_organization_data_snapshots(batch_size: int = 100) -> dict:
"""Refresh all organization data snapshots for API v2."""
result = OrganizationDataSnapshotRefreshService.refresh(batch_size=batch_size)
cache.clear()
payload = {
"processed": result.processed,
"created": result.created,
"updated": result.updated,
}
logger.info("All organization data snapshots refreshed: %s", payload)
return payload
@shared_task
def refresh_organization_data_snapshots_for_parser_batch(
*,