sebleier/django-redis-cache — pull request #34 by mattrobenolt (2012-03-28 02:48:34+00:00)
Title: Implement cache.add with SETNX so cache.add can be atomic like it's expected

The way it is now, doing a cache.add has a slight race condition
between checking if the key exists already before setting.

This rewrite uses the native SETNX command to only set the key if one
doesn't exist yet.