diff --git a/src/calibre/ebooks/metadata/sources/update.py b/src/calibre/ebooks/metadata/sources/update.py index c76b6cb6cf..44969d43f6 100644 --- a/src/calibre/ebooks/metadata/sources/update.py +++ b/src/calibre/ebooks/metadata/sources/update.py @@ -20,7 +20,7 @@ from calibre.utils.https import get_https_resource_securely cache = JSONConfig('metadata-sources-cache.json') -UPDATE_INTERVAL = 24 * 60 * 60 +UPDATE_INTERVAL = 12 * 60 * 60 current_search_engines = builtin_search_engines @@ -113,6 +113,7 @@ def main(report_error=prints, report_action=prints): 'Failed to get metadata sources hashes with error: {}'.format(as_unicode(e))) return if not needed: + cache.touch() return updated = {} for name, expected_hash in needed.iteritems(): diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index ce69cd56c8..e921b73e19 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -292,6 +292,12 @@ class XMLConfig(dict): except EnvironmentError: return 0 + def touch(self): + try: + os.utime(self.file_path, None) + except EnvironmentError: + pass + def raw_to_object(self, raw): return plistlib.readPlistFromString(raw)