2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-02 15:36:05 +00:00

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.
This commit is contained in:
Markus Hilger
2026-08-13 18:10:05 +02:00
parent 8649b22605
commit c1545cdf3f
@@ -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):