OLD | NEW |
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 Loading... |
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 |
OLD | NEW |