comparison piecrust/appconfig.py @ 887:c0cbcd4752f0

internal: Include the number of fixup callback in the cache key.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 20 Jun 2017 21:14:41 -0700
parents 08e02c2a2a1a
children 6c445771a8dc
comparison
equal deleted inserted replaced
886:dcdec4b951a1 887:c0cbcd4752f0
100 cache_key_hash = hashlib.md5( 100 cache_key_hash = hashlib.md5(
101 ("version=%s&cache=%d" % ( 101 ("version=%s&cache=%d" % (
102 APP_VERSION, CACHE_VERSION)).encode('utf8')) 102 APP_VERSION, CACHE_VERSION)).encode('utf8'))
103 for p in paths: 103 for p in paths:
104 cache_key_hash.update(("&path=%s" % p).encode('utf8')) 104 cache_key_hash.update(("&path=%s" % p).encode('utf8'))
105 cache_key_hash.update(
106 ("&fixups=%d" % len(self._post_fixups)).encode('utf8'))
105 cache_key = cache_key_hash.hexdigest() 107 cache_key = cache_key_hash.hexdigest()
106 108
107 # Check the cache for a valid version. 109 # Check the cache for a valid version.
108 if path_times and self._cache.isValid('config.json', path_times): 110 if path_times and self._cache.isValid('config.json', path_times):
109 logger.debug("Loading configuration from cache...") 111 logger.debug("Loading configuration from cache...")