Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: app/models/package.py

Issue 1134803003: Also invalidate the UI cache for a package (Closed) Base URL: https://github.com/dart-lang/pub-dartlang.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import cgi 5 import cgi
6 import json 6 import json
7 import logging 7 import logging
8 8
9 from google.appengine.api import memcache 9 from google.appengine.api import memcache
10 from google.appengine.api import users 10 from google.appengine.api import users
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 description of the package changes. This isn't often since most package 225 description of the package changes. This isn't often since most package
226 data is immutable, but when the uploader list changes or new versions 226 data is immutable, but when the uploader list changes or new versions
227 of the package are uploaded, the data will change. 227 of the package are uploaded, the data will change.
228 """ 228 """
229 logging.info("Invalidating memcache keys: %s and %s" 229 logging.info("Invalidating memcache keys: %s and %s"
230 % (self._package_json_cache_key, 230 % (self._package_json_cache_key,
231 self._dart_package_json_cache_key)) 231 self._dart_package_json_cache_key))
232 232
233 memcache.delete(self._package_json_cache_key) 233 memcache.delete(self._package_json_cache_key)
234 memcache.delete(self._dart_package_json_cache_key) 234 memcache.delete(self._dart_package_json_cache_key)
235 memcache.delete(self._dart_package_ui_cache_key)
235 236
236 @property 237 @property
237 def _package_json_cache_key(self): 238 def _package_json_cache_key(self):
238 """The memcache key for the cached JSON for this package.""" 239 """The memcache key for the cached JSON for this package."""
239 return 'package_json_' + self.name 240 return 'package_json_' + self.name
240 241
241 @property 242 @property
242 def _dart_package_json_cache_key(self): 243 def _dart_package_json_cache_key(self):
243 """The Dart memcache key for the cached JSON for this package.""" 244 """The Dart memcache key for the cached JSON for this package."""
244 return 'dart_package_json' + self.name 245 return 'dart_package_json' + self.name
246
247 @property
248 def _dart_package_ui_cache_key(self):
249 """The Dart memcache key for the cached UI page for this package."""
250 return 'dart_package_ui' + self.name
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698