Closed GoogleCodeExporter closed 9 years ago
I misstook memcache key 'gaewiki:settings'
It conflicts at settings.py:36
diff -urN -x '*.yaml' -x '*.bat' -x '*.pyc' gaewiki.orig/gaewiki/model.py
gaewiki/gaewiki/model.py
--- gaewiki.orig/gaewiki/model.py 2011-08-05 01:20:06 +0900
+++ gaewiki/gaewiki/model.py 2011-12-01 00:24:50 +0900
@@ -262,11 +264,18 @@
"""Finds and loads the page by its title, creates a new one if nothing
could be found."""
title = title.replace('_', ' ')
- page = cls.gql('WHERE title = :1', title).get()
+
+ page = None
+ if title != 'gaewiki:settings':
+ page = memcache.get(title)
+ if page is None:
+ page = cls.gql('WHERE title = :1', title).get()
if page is None:
page = cls(title=title)
if default_body is not None:
page.body = default_body
+ elif title != 'gaewiki:settings':
+ memcache.set(title, page)
return page
@classmethod
Original comment by h.rayflood
on 30 Nov 2011 at 3:34
Original comment by justin.forest
on 30 Nov 2011 at 3:47
I moved memcache.delete(self.title) from update() to put().
diff -urN -x '*.yaml' -x '*.bat' -x '*.pyc' gaewiki.orig/gaewiki/model.py
gaewiki/gaewiki/model.py
--- gaewiki.orig/gaewiki/model.py 2011-08-05 01:20:06 +0900
+++ gaewiki/gaewiki/model.py 2011-12-01 01:15:51 +0900
@@ -173,6 +174,7 @@
self.add_implicit_labels()
db.Model.put(self)
settings.check_and_flush(self)
+ memcache.delete(self.title)
def __update_geopt(self):
"""Updates the geopt property from the appropriate page property.
Original comment by h.rayflood
on 30 Nov 2011 at 4:21
This issue was updated by revision cd230a64825b.
Use the main() function.
Original comment by justin.forest
on 30 Nov 2011 at 7:27
This issue was closed by revision 5780787267c5.
Original comment by justin.forest
on 30 Nov 2011 at 7:27
Thank you.
Original comment by justin.forest
on 30 Nov 2011 at 7:33
Original issue reported on code.google.com by
h.rayflood
on 30 Nov 2011 at 2:51