cameronmaske / celery-once

Celery Once allows you to prevent multiple execution and queuing of celery tasks.
https://pypi.python.org/pypi/celery_once/
BSD 2-Clause "Simplified" License
662 stars 90 forks source link

Use SETNX when setting the lock #7

Closed frewsxcv closed 6 years ago

frewsxcv commented 9 years ago

http://redis.io/commands/setnx

This would prevent a race condition in which a lock is set multiple times. The result would need to be checked to make sure the lock was successfully set.

cameronmaske commented 9 years ago

Read more about this! This article does a good job diving into more details of why it would be useful. This is worth doing, thanks for the heads up!

ntcong commented 7 years ago

If anyone has interest in this, I have 1 PR but in Tripadvisor's fork (because they are much newer) https://github.com/tripadvisor/celery-once/pull/4

blueyed commented 7 years ago

@ntcong Thanks.

@cameronmaske Is the project still maintained? https://github.com/TrackMaven/celery-once/pull/34 would be nice to have merged, too.

jheld commented 6 years ago

@cameronmaske are you considering using Redlock, or something else? Seems SETNX is a decent solution, but even they talk about Redlock.

cameronmaske commented 6 years ago

Closing out a 3 year old ticket! Better late then never I guess. This is live on 2.0.0 enjoy.