diff --git a/vdirsyncer/__init__.py b/vdirsyncer/__init__.py index bd1b9be..6e32578 100644 --- a/vdirsyncer/__init__.py +++ b/vdirsyncer/__init__.py @@ -8,3 +8,7 @@ __version__ = pkg_resources.get_distribution('vdirsyncer').version PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer' DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/latest' + +# Increase whenever upgrade potentially breaks discovery cache and collections +# should be re-discovered +discovery_cache_version = 1 diff --git a/vdirsyncer/cli/utils.py b/vdirsyncer/cli/utils.py index 9876342..547df4e 100644 --- a/vdirsyncer/cli/utils.py +++ b/vdirsyncer/cli/utils.py @@ -145,10 +145,13 @@ def get_status_name(pair, collection): def _get_collections_cache_key(pair_options, config_a, config_b): + from vdirsyncer import discovery_cache_version m = hashlib.sha256() j = json.dumps([ + discovery_cache_version, pair_options.get('collections', None), - config_a, config_b + config_a, + config_b ], sort_keys=True) m.update(j.encode('utf-8')) return m.hexdigest()