@@ -1466,12 +1466,8 @@ def investigate_fragment(name_fragment: str):
14661466 # Ensure name_fragment does not interact badly with the cache key handling
14671467 name_digest = sha384 (name_fragment .encode ("utf8" )).hexdigest ()
14681468 cache_key = f"investigate_fragment:{ name_digest } "
1469- cached_result = cache .get (cache_key )
1470- if cached_result is not None :
1471- can_verify = cached_result ["can_verify" ]
1472- unverifiable_collections = cached_result ["unverifiable_collections" ]
1473- unexpected = cached_result ["unexpected" ]
1474- else :
1469+ result = cache .get (cache_key )
1470+ if result is None :
14751471 can_verify = set ()
14761472 for root in [settings .INTERNET_DRAFT_PATH , settings .INTERNET_DRAFT_ARCHIVE_DIR ]:
14771473 can_verify .update (list (Path (root ).glob (f"*{ name_fragment } *" )))
@@ -1494,21 +1490,14 @@ def investigate_fragment(name_fragment: str):
14941490 Path (settings .INTERNET_ALL_DRAFTS_ARCHIVE_DIR ).glob (f"*{ name_fragment } *" )
14951491 )
14961492 unexpected = [p for p in maybe_unexpected if p .name not in expected_names ]
1497- cache .set (
1498- key = cache_key ,
1499- timeout = 3600 , # 1 hour
1500- value = {
1501- "can_verify" : can_verify ,
1502- "unverifiable_collections" : unverifiable_collections ,
1503- "unexpected" : unexpected ,
1504- }
1493+ result = dict (
1494+ can_verify = can_verify ,
1495+ unverifiable_collections = unverifiable_collections ,
1496+ unexpected = unexpected ,
15051497 )
1506-
1507- return dict (
1508- can_verify = can_verify ,
1509- unverifiable_collections = unverifiable_collections ,
1510- unexpected = unexpected ,
1511- )
1498+ # 1 hour caching
1499+ cache .set (key = cache_key , timeout = 3600 , value = result )
1500+ return result
15121501
15131502
15141503def update_or_create_draft_bibxml_file (doc , rev ):
0 commit comments