Comment #1 on issue 2538 by e...@tibco.com: Djblets: memcached leakage across instances - when instances run same server domain but different site root
http://code.google.com/p/reviewboard/issues/detail?id=2538

I believe the following patch does the job of fixing this issue against the Djblets project:


diff --git a/djblets/util/misc.py b/djblets/util/misc.py
index 5fb8da8..521bfab 100644
--- a/djblets/util/misc.py
+++ b/djblets/util/misc.py
@@ -193,7 +193,12 @@ def make_cache_key(key):
         site = Site.objects.get_current()

         # The install has a Site app, so prefix the domain to the key.
-        key = "%s:%s" % (site.domain, key)
+        # Also prefix the site root, if there is one, to allow for
+        # multiple instances on the same host.
+        if settings.SITE_ROOT:
+            key = "%s:%s:%s" % (site.domain, settings.SITE_ROOT, key)
+        else:
+            key = "%s:%s" % (site.domain, key)
     except:
         # The install doesn't have a Site app, so use the key as-is.
         pass


--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to