From c1545cdf3f8aff70f881b28550d2af85bc2a7bf4 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Thu, 13 Aug 2026 18:10:05 +0200 Subject: [PATCH] Drop the redfish url cache when something is written Reads are cached for thirty seconds and a write did not invalidate anything, so setting a boot device or the identify state and then reading it back reported the value from before the write for up to half a minute. A write can change documents other than the one written, an action url not being the resource it acts on, so drop the cache rather than one entry. --- confluent_server/aiohmi/redfish/command.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/confluent_server/aiohmi/redfish/command.py b/confluent_server/aiohmi/redfish/command.py index f82f0f64..de6a813f 100644 --- a/confluent_server/aiohmi/redfish/command.py +++ b/confluent_server/aiohmi/redfish/command.py @@ -606,6 +606,12 @@ class Command(object): if payload is None and method is None: self._urlcache[url] = {'contents': res[0], 'vintage': os.times()[4]} + elif method != 'GET': + # A write may have changed anything, including documents other than + # the one written (an action url is not the resource it acts on), so + # do not let a cached read from before the write be handed out as + # the current state + self._urlcache.clear() return res[0] async def get_bootdev(self):