Hello!
I am trying to clear out a cache definition from all its entries via de cache API by executing the following code:
if result:
# Invalidate the availability cache.
# TODO: Invalidate the affected portion only (i.e. entries
# whose dates overlap for the same room id).
cache = self.cache.get_cache('builtin', 'availability')
if cache:
cache.clear()
And I am getting this error:
2019-03-04 16:35:11,114 DEBG 'zato-server2' stdout output:
2019-03-04 16:35:11,113 - WARNING - 134:DummyThread-46 - zato.server.connection.cache:860 - Could not run `CLEAR` after_state_changed in cache `availability`, data:`{u'action': '106403', u'source_worker_id': u'1.2.134.7b984a317ba22d24879c4211', u'cache_name': u'availability'}`, e:`Traceback (most recent call last):
File "/opt/zato/3.0/code/zato-server/src/zato/server/connection/cache.py", line 839, in after_state_changed
key = data['key']
KeyError: u'key'
`
This is after successfully creating a new reservation, which requires, at the time, from such operation. At the moment of execution, the cache collection exists and has just one entry whose key is:
check_in:2017-07-01|check_out:2017-07-10|guests:2|rooms:[2]
And whose value is:
[Bunch(accommodates=4, code=u'g9ZQMQ', dbl_beds=1, id=2, name=u'Large bedroom with two single and one double beds', nights=9, number=u'102', price=972.0, sgl_beds=2, taxes_percentage=21.0, taxes_value=205.0, total_price=1177.0)]
What am I doing wrong?