adapters: update cache file ctime on refresh (#86977)
gitea/django-mellon/pipeline/head Build queued...
Details
gitea/django-mellon/pipeline/head Build queued...
Details
This commit is contained in:
parent
244ca2abcd
commit
b372884c2d
|
@ -196,7 +196,7 @@ class DefaultAdapter:
|
|||
)
|
||||
return
|
||||
|
||||
if idp.get('METADATA') != response.text:
|
||||
if idp.get('METADATA') != response.text or not os.path.exists(file_cache_path):
|
||||
idp['METADATA'] = response.text
|
||||
logger.info('mellon: metadata url %s updated', url)
|
||||
idp['METADATA_LAST_UPDATE'] = now
|
||||
|
@ -211,6 +211,8 @@ class DefaultAdapter:
|
|||
file_cache_path,
|
||||
e,
|
||||
)
|
||||
else:
|
||||
os.utime(file_cache_path)
|
||||
finally:
|
||||
# release thread object
|
||||
idp.pop('METADATA_URL_UPDATE_THREAD', None)
|
||||
|
|
Loading…
Reference in New Issue