Changeset 8620
- Timestamp:
- 08/27/08 03:58:51 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/sessions/backends/cache.py
r8410 r8620 18 18 19 19 def create(self): 20 while True: 20 # Because a cache can fail silently (e.g. memcache), we don't know if 21 # we are failing to create a new session because of a key collision or 22 # because the cache is missing. So we try for a (large) number of times 23 # and then raise an exception. That's the risk you shoulder if using 24 # cache backing. 25 for i in xrange(10000): 21 26 self.session_key = self._get_new_session_key() 22 27 try: … … 26 31 self.modified = True 27 32 return 33 raise RuntimeError("Unable to create a new session key.") 28 34 29 35 def save(self, must_create=False):
