دليل هندسي: Hire a Freelance Django & Celery Programmer for Idempotent Distributed Queues. ألديان فازريهادي (Aldian Fazrihady) مبرمج مستقل أول ومهندس ذكاء اصطناعي (Python, Django, FastAPI, React, Next.js, TypeScript, Golang).

Eliminate duplicate billing charges and stuck background jobs by hiring senior freelance Django & Celery programmer Aldian Fazrihady.

from django.db import transaction
from celery import shared_task
from core.models import IdempotencyLock, Invoice

@shared_task(bind=True, max_retries=5, acks_late=True, reject_on_worker_lost=True)
def process_invoice_settlement(self, invoice_id: int, idempotency_key: str) -> str:
    with transaction.atomic():
        lock, created = IdempotencyLock.objects.select_for_update().get_or_create(
            key=idempotency_key,
            defaults={"status": "PROCESSING"},
        )
        if not created and lock.status == "COMPLETED":
            return "ALREADY_SETTLED"
        invoice = Invoice.objects.select_for_update().get(id=invoice_id)
        invoice.mark_settled()
        lock.status = "COMPLETED"
        lock.save(update_fields=["status"])
    return "SETTLED"

توظيف عبر Upwork | دليل 455+ مقال هندسي


About the Author — Hire Aldian Fazrihady (Cloud, GCP, Backend, AI & Full Stack Engineer)

Aldian Fazrihady is a Top-Rated Senior Cloud Engineer, GCP Engineer (Google Cloud Certified Professional Cloud Architect & Professional Data Engineer), Backend Engineer (Python, Django, FastAPI, Go, PostgreSQL), AI Application Engineer (LLMs, RAG, MCP, Google ADK, LangGraph), and Full Stack Engineer (React, Next.js, TypeScript) with 15+ years of production software engineering experience.

Hire Aldian Fazrihady on Upwork | Book 1-Day Programming Service ($100 USD / Rp 1.000.000) | View Live AI Portfolio | Portfolio Directory | Send a Direct Message

Related Engineering Articles

Engineering Specializations & Category Hubs