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

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

Issue 952503002: When invalidating memcache, also invalidate the cache for dart (Closed) Base URL: https://github.com/dart-lang/pub-dartlang.git@master
Patch Set: Updating app.yaml to use version 33 Created 5 years, 9 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 | « app/app.yaml ('k') | 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 def invalidate_cache(self): 220 def invalidate_cache(self):
221 """Clears the cached JSON for the package. 221 """Clears the cached JSON for the package.
222 222
223 This must be called any time any data that is in the JSON for the full 223 This must be called any time any data that is in the JSON for the full
224 description of the package changes. This isn't often since most package 224 description of the package changes. This isn't often since most package
225 data is immutable, but when the uploader list changes or new versions 225 data is immutable, but when the uploader list changes or new versions
226 of the package are uploaded, the data will change. 226 of the package are uploaded, the data will change.
227 """ 227 """
228 memcache.delete(self._package_json_cache_key) 228 memcache.delete(self._package_json_cache_key)
229 memcache.delete(self._dart_package_json_cache_key)
229 230
230 @property 231 @property
231 def _package_json_cache_key(self): 232 def _package_json_cache_key(self):
232 """The memcache key for the cached JSON for this package.""" 233 """The memcache key for the cached JSON for this package."""
233 return 'package_json_' + self.name 234 return 'package_json_' + self.name
235
236 @property
237 def _dart_package_json_cache_key(self):
238 """The Dart memcache key for the cached JSON for this package."""
239 return 'dart_package_json_' + self.name
OLDNEW
« no previous file with comments | « app/app.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698