--- id: celery-once version: "3.0.1" license: BSD license_treatment: permissive maintenance: abandoned --- # celery_once — Allows you to prevent multiple execution and queuing of celery tasks. License: permissive · Maintenance: abandoned · Downloads: 275.5K/mo ## What it is and what it does Celery Once is a Celery extension that adds distributed task locking to prevent the same task from being queued or executed multiple times concurrently. It works by intercepting task scheduling calls (delay and apply_async) and checking a lock in a backend store (Redis or filesystem) before allowing execution. If a lock already exists, it raises an AlreadyQueued exception or returns None gracefully, depending on configuration. The package lets you configure which task arguments determine lock identity, set lock timeouts, and choose when locks are released (after task completion or before execution). It is designed for scenarios where you want to ensure a long-running or resource-intensive task does not pile up in the queue or run in parallel, but the project has been unmaintained since 2019 and may not work reliably with current Celery and Python versions. Use it for: - Prevent duplicate report generation tasks from queuing when a user clicks a button multiple times before the first report completes. - Ensure only one data sync task runs at a time across a distributed worker pool, even if triggered by multiple sources. - Block redundant cleanup or maintenance tasks from running concurrently when scheduled by multiple cron jobs or webhooks. - Enforce single-execution semantics for expensive API calls or database operations triggered by task retries or event handlers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Prevents duplicate execution and queuing of Celery tasks by enforcing distributed locks, allowing you to ensure a task runs only once even if scheduled multiple times concurrently. No. The package is abandoned (last release 2019, no commits since 2023) and unlikely to work with modern Celery or Python versions. If you need task deduplication in an active Celery project, seek a maintained alternative or implement locking directly using Redis or your message broker's native capabilities. ## Install pip install celery-once uv add celery-once poetry add celery-once ## Installing celery_once Before you install: High install friction: the package has been abandoned since 2019 with no updates for over 2550 days, and it requires external infrastructure (Redis or file-based locking) to function. No runtime dependencies are declared, but Celery itself is a hard requirement that must be installed separately. License in practice: BSD license is permissive, imposing no significant restrictions on use or redistribution in most contexts. Quickstart: pip install celery_once from celery import Celery from celery_once import QueueOnce celery = Celery('tasks', broker='amqp://guest@localhost//') celery.conf.ONCE = {'backend': 'celery_once.backends.Redis', 'settings': {'url': 'redis://localhost:6379/0', 'default_timeout': 3600}} @celery.task(base=QueueOnce) def my_task(): return "Done!" Requires Celery 4.0 or later, a running message broker (e.g. RabbitMQ), and a Redis instance or writable filesystem for lock storage. Verify before relying: - Whether the package works reliably with Celery versions released after 2019 or with modern Python 3.10+. - Whether the Redis backend handles connection failures or network partitions gracefully. - Whether lock cleanup is guaranteed under all failure scenarios (e.g. task crashes, worker death). ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 275.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags celery task deduplication, prevent duplicate celery tasks, celery task locking, celery once execution, distributed task lock, celery queue deduplication, celery task idempotence, celery-extension, task-locking, abandoned [View on SkillFed](https://skillfed.io/packages/celery-once) · [View on PyPI](https://pypi.org/project/celery-once/)