@@ -55,12 +55,11 @@ async def _sanitize_input_json_files(self) -> None:
55
55
alternative_keys = configuration .input_key_candidates - {configuration .canonical_input_key }
56
56
57
57
if (self .path_to_kvs / configuration .canonical_input_key ).exists ():
58
- # Handle missing metadata
59
- if not await self .record_exists (key = configuration .canonical_input_key ):
60
- input_data = await asyncio .to_thread (
61
- lambda : json .loads ((self .path_to_kvs / configuration .canonical_input_key ).read_text ())
62
- )
63
- await self .set_value (key = configuration .canonical_input_key , value = input_data )
58
+ # Refresh metadata to prevent inconsistencies
59
+ input_data = await asyncio .to_thread (
60
+ lambda : json .loads ((self .path_to_kvs / configuration .canonical_input_key ).read_text ())
61
+ )
62
+ await self .set_value (key = configuration .canonical_input_key , value = input_data )
64
63
65
64
for alternative_key in alternative_keys :
66
65
if (alternative_input_file := self .path_to_kvs / alternative_key ).exists ():
@@ -69,11 +68,10 @@ async def _sanitize_input_json_files(self) -> None:
69
68
for alternative_key in alternative_keys :
70
69
alternative_input_file = self .path_to_kvs / alternative_key
71
70
72
- # Handle missing metadata
73
- if alternative_input_file .exists () and not await self .record_exists (key = alternative_key ):
74
- with alternative_input_file .open () as f :
75
- input_data = await asyncio .to_thread (lambda : json .load (f ))
76
- await self .set_value (key = configuration .canonical_input_key , value = input_data )
71
+ # Refresh metadata to prevent inconsistencies
72
+ with alternative_input_file .open () as f :
73
+ input_data = await asyncio .to_thread (lambda : json .load (f ))
74
+ await self .set_value (key = configuration .canonical_input_key , value = input_data )
77
75
78
76
@override
79
77
async def get_value (self , * , key : str ) -> KeyValueStoreRecord | None :
0 commit comments