From 5926bc3b8cc422d9a0e98d15228866ee2d624e3d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 20 Apr 2012 16:28:44 -0400 Subject: add a note about get_or_create() expiration_time. --- dogpile/cache/region.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dogpile/cache/region.py b/dogpile/cache/region.py index c6a3e84..9e39498 100644 --- a/dogpile/cache/region.py +++ b/dogpile/cache/region.py @@ -218,6 +218,20 @@ class CacheRegion(object): :param expiration_time: optional expiration time which will overide the expiration time already configured on this :class:`.CacheRegion` if not None. To set no expiration, use the value -1. + + .. note:: + + the expiration_time argument here is **not guaranteed** to be + effective if multiple concurrent threads are accessing the same + key via :meth:`get_or_create` using different values + for ``expiration_time`` - the first thread within a cluster + of concurrent usages establishes the expiration time within a + :class:`.Dogpile` instance for the duration of those usages. + It is advised that all access to a particular key within a particular + :class:`.CacheRegion` use the **same** value for ``expiration_time``. + Sticking with the default expiration time configured for + the :class:`.CacheRegion` as a whole is expected to be the + usual mode of operation. """ if self.key_mangler: -- cgit v1.2.1