celery_once
Allows you to prevent multiple execution and queuing of celery tasks.
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 on this page — 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
celery-once on PyPI
pip
pip install celery-onceuv
uv add celery-oncepoetry
poetry add celery-onceInstalling 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 | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,550 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 275,459/month — #8,176 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: celery_once-3.0.1.tar.gz
Keywords: celery
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
celery-singletonPrevents duplicate Celery tasks from being…
permissive · top 15,000 on PyPI
celery-redbeatRedBeat is a Celery Beat scheduler that…
permissive · top 5,000 on PyPI
celeryCelery is a distributed task queue that lets…
permissive · top 1,000 on PyPI
redlockImplements the RedLock algorithm to provide…
permissive · top 15,000 on PyPI
celery-batchesCelery Batches provides a Task class that…
permissive · top 15,000 on PyPI
celery-stubsProvides type stubs for Celery to enable static…
permissive · top 15,000 on PyPI
aioredlockImplements the Redlock distributed lock…
permissive · top 15,000 on PyPI
redlock-pyImplements Redis-based distributed locks using…
permissive · top 15,000 on PyPI
gilknockerMeasures GIL contention within a specific code…
unclear · top 5,000 on PyPI
wakepyWakepy prevents a system from sleeping or…
permissive · top 15,000 on PyPI